Need help with /myinfo command - 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)
+--- Thread: Need help with /myinfo command (
/showthread.php?tid=321807)
Need help with /myinfo command -
Gangs_Rocks - 28.02.2012
CMD:myinfo(playerid,params[])
{
GetPlayerIp(playerid, name[], len);
GetPlayerSkin(playerid);
GetPlayerScore(playerid);
GetPlayerMoney(playerid);
GetPlayerWeapon(playerid);
GetPlayerAmmo(playerid);
GetPlayerPing(playerid);
return 1;
}
Quote:
C:\Users\ADMIN\Desktop\Server\gamemodes\Testing.pw n(49 : error 017: undefined symbol "name"
|
I get this error when compiling. I need to know what I did wrong + I need to know how to show this to the player. I'm a newb.
Re: Need help with /myinfo command -
Konstantinos - 28.02.2012
pawn Код:
CMD:myinfo( playerid, params[ ] )
{
new p_IP[ 16 ], sz_msg[ 128 ];
GetPlayerIp( playerid, p_IP, 16 );
format( sz_msg, sizeof( sz_msg ), "IP: (%s) Skin: (%d) Score: (%d) Money: (%d) Weapon: (%d) Ammo: (%d) Ping: (%d)", p_IP, GetPlayerSkin( playerid ), GetPlayerScore( playerid ), GetPlayerMoney( playerid ), GetPlayerWeapon( playerid ), GetPlayerAmmo( playerid ), GetPlayerPing( playerid ) );
SendClientMessage( playerid, -1, sz_msg );
return 1;
}
You have to make a new variable to store the ip.
Also, you should format the message and then send the custom one.