Započeo []Flynâ„¢
•29. Jan. 2011.[Pomoc] Komanda
1,009
pregleda
6
postova
Kingpin
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
240 / 250 XP
Početnik(0)
1,126
Postovi:
91
Teme:
Pridružio se:Jul 2010
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;
}
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;
}
Godfather
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
241 / 250 XP
Početnik(0)
2,248
Postovi:
66
Teme:
Pridružio se:Mar. 2010
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;
}
{
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;
}
Legenda Foruma
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosAktivan Član
12 / 250 XP
Početnik(1)
888
Postovi:
66
Teme:
Pridružio se:Okt. 2009
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)
{
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)
Legenda Foruma
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosAktivan Član
12 / 250 XP
Početnik(1)
888
Postovi:
66
Teme:
Pridružio se:Okt. 2009
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
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