[Pomoc] Komanda

Započeo []Flynâ„¢
29. Jan. 2011.
1,003
pregleda
6
postova
Marjan_King
5
Kingpin
29. Jan. 2011.
Poceo sam prebacivati sve komande u ZCMD, jos uvek ne razumem tako dobro ZCMD pa ako nije problem ko zna da mi neke komande oko kojih budem imao problem uradi(prebaci)Obicno su to komande u kojima moras upisati igracem ID ili /komanda ..Evo npr /veh komanda..

if(strcmp(cmd, "/veh", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if (PlayerInfo < 1)
{
    SendClientMessage(playerid, COLOR_GRAD1, "Moras biti Admin lvl:1");
    return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, CRVENA, "Komanda: /veh ");
return 1;
}
new car;
car = strvalEx(tmp);
if(car < 400 || car > 611) { SendClientMessage(playerid, SIVA, "Broj auta moze biti izmedu 400 i 611 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORSITI: /veh ");
return 1;
}
new color1;
color1 = strvalEx(tmp);
if(color1 < 0 || color1 > 126) { SendClientMessage(playerid, SIVA, "Boja auta moze biti izmedu 1 i 126 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, CRVENA, "Komanda: /veh ");
return 1;
}
new color2;
color2 = strvalEx(tmp);
if(color2 < 0 || color2 > 126) { SendClientMessage(playerid, SIVA, "Boja auta moze biti izmedu 1 i 126 !"); return 1; }
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
new carid = CreateVehicle(car, X,Y,Z, 0.0, color1, color2, -1);
CreatedCars = carid;
CreatedCar ++;
format(string, sizeof(string), "*Vozilo %d je stvoreno*", carid);
SendClientMessage(playerid, SVETLOPLAVA, string);
Vehano = 1;
}
return 1;
}
aleluja
5
Godfather
29. Jan. 2011.
CMD:veh(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
        if (PlayerInfo < 1)
{
     SendClientMessage(playerid, COLOR_GRAD1, "Moras biti Admin lvl:1");
    return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, CRVENA, "Komanda: /veh ");
return 1;
}
new car;
car = strvalEx(tmp);
if(car < 400 || car > 611) { SendClientMessage(playerid, SIVA, "Broj auta moze biti izmedu 400 i 611 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORSITI: /veh ");
return 1;
}
new color1;
color1 = strvalEx(tmp);
if(color1 < 0 || color1 > 126) { SendClientMessage(playerid, SIVA, "Boja auta moze biti izmedu 1 i 126 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, CRVENA, "Komanda: /veh ");
return 1;
}
new color2;
color2 = strvalEx(tmp);
if(color2 < 0 || color2 > 126) { SendClientMessage(playerid, SIVA, "Boja auta moze biti izmedu 1 i 126 !"); return 1; }
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
new carid = CreateVehicle(car, X,Y,Z, 0.0, color1, color2, -1);
CreatedCars = carid;
CreatedCar ++;
format(string, sizeof(string), "*Vozilo %d je stvoreno*", carid);
SendClientMessage(playerid, SVETLOPLAVA, string);
Vehano = 1;
}
return 1;
}
Marjan_King
5
Kingpin
29. Jan. 2011.
Samo taj prvi red se menja? A kada je sa SSCANFom onda se jos nesx menja..tako?
Viky
6
Legenda Foruma
29. Jan. 2011.
CMD:veh(playerid,params[])
{
new model;
if(Igrac < 9) return SendMessage(playerid,"{FFCAFA}Nisi admin! (lvl 9+)");
if(sscanf(params,"i",model)) return SendMessage(playerid,"{F00F00}Koristi: /veh ");
if(model < 400 || model > 611 ) return SendMessage(playerid,"{FA000C}Id vozila mora biti izmedju 400 i 611!");
new Float:x,Float:y,Float:z,Float:a;
GetPlayerPos(playerid,x,y,z); SetPlayerFacingAngle(playerid,a);
CreateVehicle(model,x,y,z,a,-1,-1,60000);
return 1;
}

I na vrh:

#define SendMessage(%0,%2) SendClientMessage(%0,0xFFFFFFFF,%2)
Marjan_King
5
Kingpin
29. Jan. 2011.
E to care.. tNx
Aj mi samo daj definiciju ili sta imas za ovo if(Igrac
Viky
6
Legenda Foruma
29. Jan. 2011.
joXy wrote on January 29, 2011, 11:07 am:
E to care.. tNx
Aj mi samo daj definiciju ili sta imas za ovo if(Igrac


omg....

PlayerInfo ti stavi

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha