[SOLVED] Help seeing player weapons (Solved with: Without dcmd just #define)
#1

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.
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;
        }
The errors:
Код:
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
Can someone help? Thanks.
Reply


Messages In This Thread
[SOLVED] Help seeing player weapons (Solved with: Without dcmd just #define) - by speedruntrainer - 16.08.2009, 21:28
Re: Need help with checking an id's weapon ingame. (NOT with dcmd) - by Googles - 16.08.2009, 22:36
Re: Need help with checking an id's weapon ingame. (NOT with dcmd) - by _Vortex - 16.08.2009, 22:37
Re: Need help with checking an id's weapon ingame. (NOT with dcmd) - by speedruntrainer - 16.08.2009, 23:17
Re: Need help with checking an id's weapon ingame. (NOT with dcmd) - by Googles - 16.08.2009, 23:25

Forum Jump:


Users browsing this thread: 3 Guest(s)