[SOLVED] Help seeing player weapons (Solved with: Without dcmd just #define) - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [SOLVED] Help seeing player weapons (Solved with: Without dcmd just #define) (
/showthread.php?tid=91819)
[SOLVED] Help seeing player weapons (Solved with: Without dcmd just #define) -
speedruntrainer - 16.08.2009
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.
Re: Need help with checking an id's weapon ingame. (NOT with dcmd) -
Googles - 16.08.2009
You Got MSN Or Teamviewer? Ill help you out
! ITs an easy Error Fix.
Re: Need help with checking an id's weapon ingame. (NOT with dcmd) -
_Vortex - 16.08.2009
Quote:
Originally Posted by ******s
You Got MSN Or Teamviewer? Ill help you out ! ITs an easy Error Fix.
|
Or you can just tell him on here, there's no need to go on teamviewer or msn.
Re: Need help with checking an id's weapon ingame. (NOT with dcmd) -
speedruntrainer - 16.08.2009
Quote:
Originally Posted by ******s
You Got MSN Or Teamviewer? Ill help you out ! ITs an easy Error Fix.
|
LOL Epic Fail, I'm never on msn and WTF is team viewer? Just tell me how to fix here lol.
Re: Need help with checking an id's weapon ingame. (NOT with dcmd) -
Googles - 16.08.2009
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"
Your missing new files add this to the top of your GM somewhere
new PlayerName2;
Problem Should be solved.