SA-MP Forums Archive
GetPlayerWeaponData [SOLVED] - 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: GetPlayerWeaponData [SOLVED] (/showthread.php?tid=144631)



GetPlayerWeaponData [SOLVED] - Sascha - 28.04.2010

How can I send a message with the weapon data of a player after using GetPlayerWeaponData?


Re: GetPlayerWeaponData - nakashor - 28.04.2010

Quote:
Originally Posted by Sascha
How can I send a message with the weapon data of a player after using GetPlayerWeaponData?
Example:
pawn Код:
new string[128];
new wep, ammo;
GetPlayerWeaponData(playerid, slot, wep, ammo);
format(string, sizeof(string), "%d",wep);
SendClientMessageToAll(COLOR,string);
If you need any help with this code, post it here as a comment.


Re: GetPlayerWeaponData - Sascha - 28.04.2010

i got that:
Код:
new msg[256];
new weapons[13][2];
for(new w = 0; w < 13; w++)
GetPlayerWeaponData(pid, w, weapons[w][0], weapons[w][1]);
format(msg, sizeof(msg), "Result: Weapon: %d", weapons[w][0]);
SendClientMessage(playerid, RED, msg);
and get "error 017: undefined symbol "w""...
the line is the "format(msg...." line



Re: GetPlayerWeaponData - nakashor - 28.04.2010

pawn Код:
new msg[256];
new weapons[13][2];

for(new w = 0; w < 13; w++)
{
GetPlayerWeaponData(pid, w, weapons[w][0], weapons[w][1]);
format(msg, sizeof(msg), "Result: Weapon: %d", weapons[w][0]);
SendClientMessage(playerid, RED, msg);
return 1;
}