16.08.2009, 21:28
Hello. Can someone help me making a command that shows the weapons of a player that you want?
I only have a code with 2 errors players checking for a minigun only.
The errors:
Can someone help? Thanks.
I only have a code with 2 errors players checking for a minigun only.
pawn Код:
if(strcmp(cmdtext, "/miniguns", true) == 0) {
new bool:First2 = false, Count, string[128], i, slot, weap, ammo;
for(i = 0; i < MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) {
for(slot = 0; slot < 14; slot++) {
GetPlayerWeaponData(i, slot, weap, ammo);
if(ammo != 0 && weap == 38) {
Count++;
if(!First2) { format(string, sizeof(string), "Minigun: (%d)%s(ammo%d)", i, PlayerName2(i), ammo); First2 = true; }
else format(string,sizeof(string),"%s, (%d)%s(ammo%d) ",string, i, PlayerName2(i), ammo);
}
}
}
}
if(Count == 0) return SendClientMessage(playerid,COLOR_WHITE,"No players have a minigun"); else return SendClientMessage(playerid,COLOR_WHITE,string);
return 1;
}
Код:
C:\Users\Nel\Desktop\Mijn spullen\GTA Games\Server test gta\filterscripts\Test.pwn(55) : error 017: undefined symbol "PlayerName2" C:\Users\Nel\Desktop\Mijn spullen\GTA Games\Server test gta\filterscripts\Test.pwn(56) : error 017: undefined symbol "PlayerName2" C:\Users\Nel\Desktop\Mijn spullen\GTA Games\Server test gta\filterscripts\Test.pwn(62) : warning 225: unreachable code