WiDuAlK Posted May 17, 2014 Report Share Posted May 17, 2014 Nick:WiDuAlKProblema:comanda /givegunErori / warnings: nu are dar as vrea sa pun la aceasta comanda si bazuka si tunul cu id 36Lini/script:[pawn] if(strcmp(cmd, "/givegun", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, " {FFA500}[iNFO]:{ffffff} /givegun [Player id] [arma id (eg. 46 = Parachute)] [gloante]"); return 1; } new playa; new gun; new ammo; playa = ReturnUser(tmp); tmp = strtok(cmdtext, idx); gun = strval(tmp); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD1, " {FFA500}[iNFO]:{ffffff} /givegun [Player id] [weaponid] [ammo]"); SendClientMessage(playerid, COLOR_GRAD4, "3(Golf club) 4 (Knife) 5 (Lilieci) 6 (Shovel) 7 (Copie) 8 (Katana) 10-13 (Dildo) 14 (Flowers) 16 (Grenati) 18 (Molotovs) 22 (9mm pistol) 23 (SPistol)"); SendClientMessage(playerid, COLOR_GRAD3, " 24 (Shotgun) 29 (MP5) 30 (AK47) 31 (M4) 33 (Pusca) 34 (Sniper) 35 (Bazuka) 37 (Flame-thrower) 41 (Spray) 43 (Camera) 46(Parachute)"); return 1; } if(gun < 1||gun > 46||gun==27||gun==1||gun==2||gun==9||gun==17||gun==19||gun==20||gun==21||gun==35||gun==36||gun==38||gun==39||gun==40||gun==44||gun==45) { SendClientMessage(playerid, COLOR_GRAD1, " Id-ul armei este invalid!"); return 1; } tmp = strtok(cmdtext, idx); ammo = strval(tmp); if(ammo <1||ammo > 9999999999) { SendClientMessage(playerid, COLOR_GRAD1, " Nu mai putin de 1 si mai mult de 999999999999 gloante!"); return 1; } if (PlayerInfo[playerid][pAdmin] >= 7) { if(IsPlayerConnected(playa)) { if(playa != INVALID_PLAYER_ID) { ServerGivePlayerWeapons(playa, gun, ammo); } } } else { SendClientMessage(playerid, COLOR_GRAD1, " Tu nu ai acces la aceasta comanda!"); } } return 1; }[/pawn]Ai incercat sa rezolvi singur ?:DA @WiDuAlK Tutorial`s: PAWN pentru SA:MP in Notepad++Tutorial Register-Login MYSQL R39 Tutorial etape de register Cum sa creezi un PayDay (2 METODE)Cum sa creezi o factiune de la 0 PART 1 Cum sa creezi o factiune de la 0 PART 2 Cum sa creezi o factiune de la 0 partea a 3-a (ULTIMA)Functii folositoare din NEW.PWN Tutorial Engine Vehicle Optimizare simplitate si stil Foreach inlocuieste loop-ul SSCANF si ZCMD Cum sa creezi o poarta miscatoare Tutorial cum sa creezi un radio pe server si cum sa iti creezi melodi pentru ascultat pe server Cum sa tii un server din PC folosind HAMACHI Documentatie* Despre hack-uri Servicii: Servicii Scripting & Mapping Produse: Farmer Job Realistic Drugs Dealer System [SA-MP] UNIQUE Link to comment Share on other sites More sharing options...
w3b Posted May 17, 2014 Report Share Posted May 17, 2014 Fi atent ,acolo unde ai if(gun < 1||gun > 46||gun==27||gun==1||gun==2||gun==9||gun==17||gun==19||gun==20||gun==21||gun==35||gun==36||gun==38||gun==39||gun==40||gun==44||gun==45) sterge tot si scrie doar if(gun < 1||gun > 46) o sa iti mearga toate armeleDaca nu te descurci sterge comanda ta si baga asta :[pawn]if(strcmp(cmd, "/givegun", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, " {FFA500}[iNFO]:{ffffff} /givegun [Player id] [arma id (eg. 46 = Parachute)] [gloante]"); return 1; } new playa; new gun; new ammo; playa = ReturnUser(tmp); tmp = strtok(cmdtext, idx); gun = strval(tmp); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD1, " {FFA500}[iNFO]:{ffffff} /givegun [Player id] [weaponid] [ammo]"); SendClientMessage(playerid, COLOR_GRAD4, "3(Golf club) 4 (Knife) 5 (Lilieci) 6 (Shovel) 7 (Copie) 8 (Katana) 10-13 (Dildo) 14 (Flowers) 16 (Grenati) 18 (Molotovs) 22 (9mm pistol) 23 (SPistol)"); SendClientMessage(playerid, COLOR_GRAD3, " 24 (Shotgun) 29 (MP5) 30 (AK47) 31 (M4) 33 (Pusca) 34 (Sniper) 35 (Bazuka) 37 (Flame-thrower) 41 (Spray) 43 (Camera) 46(Parachute)"); return 1; } if(gun < 1||gun > 46) { SendClientMessage(playerid, COLOR_GRAD1, " Id-ul armei este invalid!"); return 1; } tmp = strtok(cmdtext, idx); ammo = strval(tmp); if(ammo <1||ammo > 9999999999) { SendClientMessage(playerid, COLOR_GRAD1, " Nu mai putin de 1 si mai mult de 999999999999 gloante!"); return 1; } if (PlayerInfo[playerid][pAdmin] >= 7) { if(IsPlayerConnected(playa)) { if(playa != INVALID_PLAYER_ID) { ServerGivePlayerWeapons(playa, gun, ammo); } } } else { SendClientMessage(playerid, COLOR_GRAD1, " Tu nu ai acces la aceasta comanda!"); } } return 1; }[/pawn] Link to comment Share on other sites More sharing options...
Massari Posted May 17, 2014 Report Share Posted May 17, 2014 [pawn]if(strcmp(cmd, "/givegun", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, " {FFA500}[iNFO]:{ffffff} /givegun [Player id] [arma id (eg. 46 = Parachute)] [gloante]"); return 1; } new playa; new gun; new ammo; playa = ReturnUser(tmp); tmp = strtok(cmdtext, idx); gun = strval(tmp); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD1, " {FFA500}[iNFO]:{ffffff} /givegun [Player id] [weaponid] [ammo]"); SendClientMessage(playerid, COLOR_GRAD4, "3(Golf club) 4 (Knife) 5 (Lilieci) 6 (Shovel) 7 (Copie) 8 (Katana) 10-13 (Dildo) 14 (Flowers) 16 (Grenati) 18 (Molotovs) 22 (9mm pistol) 23 (SPistol)"); SendClientMessage(playerid, COLOR_GRAD3, " 24 (Shotgun) 29 (MP5) 30 (AK47) 31 (M4) 33 (Pusca) 34 (Sniper) 35 (Bazuka) 37 (Flame-thrower) 41 (Spray) 43 (Camera) 46(Parachute)"); return 1; } if(gun < 1||gun > 46||gun==27||gun==1||gun==2||gun==9||gun==17||gun==19||gun==20||gun==21||gun==38||gun==39||gun==40||gun==44||gun==45) { SendClientMessage(playerid, COLOR_GRAD1, " Id-ul armei este invalid!"); return 1; } tmp = strtok(cmdtext, idx); ammo = strval(tmp); if(ammo <1||ammo > 9999999999) { SendClientMessage(playerid, COLOR_GRAD1, " Nu mai putin de 1 si mai mult de 999999999999 gloante!"); return 1; } if (PlayerInfo[playerid][pAdmin] >= 7) { if(IsPlayerConnected(playa)) { if(playa != INVALID_PLAYER_ID) { ServerGivePlayerWeapons(playa, gun, ammo); } } } else { SendClientMessage(playerid, COLOR_GRAD1, " Tu nu ai acces la aceasta comanda!"); } } return 1; }[/pawn] rimmon curv. Link to comment Share on other sites More sharing options...
Mafia. Posted May 18, 2014 Report Share Posted May 18, 2014 Ai primit 2 rapunsuri !Topic CLosed ! Link to comment Share on other sites More sharing options...
Question
WiDuAlK
Nick:WiDuAlK
Problema:comanda /givegun
Erori / warnings: nu are dar as vrea sa pun la aceasta comanda si bazuka si tunul cu id 36
Lini/script:[pawn] if(strcmp(cmd, "/givegun", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, " {FFA500}[iNFO]:{ffffff} /givegun [Player id] [arma id (eg. 46 = Parachute)] [gloante]");
return 1;
}
new playa;
new gun;
new ammo;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
gun = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, " {FFA500}[iNFO]:{ffffff} /givegun [Player id] [weaponid] [ammo]");
SendClientMessage(playerid, COLOR_GRAD4, "3(Golf club) 4 (Knife) 5 (Lilieci) 6 (Shovel) 7 (Copie) 8 (Katana) 10-13 (Dildo) 14 (Flowers) 16 (Grenati) 18 (Molotovs) 22 (9mm pistol) 23 (SPistol)");
SendClientMessage(playerid, COLOR_GRAD3, " 24 (Shotgun) 29 (MP5) 30 (AK47) 31 (M4) 33 (Pusca) 34 (Sniper) 35 (Bazuka) 37 (Flame-thrower) 41 (Spray) 43 (Camera) 46(Parachute)");
return 1;
}
if(gun < 1||gun > 46||gun==27||gun==1||gun==2||gun==9||gun==17||gun==19||gun==20||gun==21||gun==35||gun==36||gun==38||gun==39||gun==40||gun==44||gun==45)
{ SendClientMessage(playerid, COLOR_GRAD1, " Id-ul armei este invalid!"); return 1; }
tmp = strtok(cmdtext, idx);
ammo = strval(tmp);
if(ammo <1||ammo > 9999999999)
{ SendClientMessage(playerid, COLOR_GRAD1, " Nu mai putin de 1 si mai mult de 999999999999 gloante!"); return 1; }
if (PlayerInfo[playerid][pAdmin] >= 7)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
ServerGivePlayerWeapons(playa, gun, ammo);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Tu nu ai acces la aceasta comanda!");
}
}
return 1;
}[/pawn]
Ai incercat sa rezolvi singur ?:DA
@WiDuAlK Tutorial`s:
PAWN pentru SA:MP in Notepad++
Tutorial Register-Login MYSQL R39
Tutorial etape de register
Cum sa creezi un PayDay (2 METODE)
Cum sa creezi o factiune de la 0 PART 1
Cum sa creezi o factiune de la 0 PART 2
Cum sa creezi o factiune de la 0 partea a 3-a (ULTIMA)
Functii folositoare din NEW.PWN
Tutorial Engine Vehicle
Optimizare simplitate si stil
Foreach inlocuieste loop-ul
SSCANF si ZCMD
Cum sa creezi o poarta miscatoare
Tutorial cum sa creezi un radio pe server si cum sa iti creezi melodi pentru ascultat pe server
Cum sa tii un server din PC folosind HAMACHI
Documentatie* Despre hack-uri
Servicii:
Servicii Scripting & Mapping
Produse:
Farmer Job Realistic
Drugs Dealer System [SA-MP] UNIQUE
Link to comment
Share on other sites
3 answers to this question
Recommended Posts