Command help... - 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: Command help... (
/showthread.php?tid=412742)
Command help... -
Strier - 02.02.2013
pawn Код:
CMD:helpme(playerid, params[])
{
if(PlayerInfo[playerid][LoggedIn])
{
new str[200], name[MAX_PLAYER_NAME];
GetPlayerName( name, sizeof(name)); GetPlayerName(playerid, sizeof(playerid));
format(str, sizeof(str), "{00FFFF}[HELP MESSAGE]: %s[%d] {FFFFFF} %s ", name, playerid, str);
}
}else return SP COLOR_RED, "You need to be logged in to use this command");
}
return 1;
}
Errors:
pawn Код:
C:\Users\Guille\Desktop\Samp scripting\Server23\Server\gamemodes\WD.pwn(12527) : error 035: argument type mismatch (argument 1)
C:\Users\Guille\Desktop\Samp scripting\Server23\Server\gamemodes\WD.pwn(12527) : error 035: argument type mismatch (argument 2)
C:\Users\Guille\Desktop\Samp scripting\Server23\Server\gamemodes\WD.pwn(12527) : error 035: argument type mismatch (argument 2)
C:\Users\Guille\Desktop\Samp scripting\Server23\Server\gamemodes\WD.pwn(12527) : fatal error 107: too many error messages on one line
Line:
pawn Код:
GetPlayerName( name, sizeof(name)); GetPlayerName(playerid, sizeof(playerid));
This is how i thought it could be done... so please help this newbie, to getbetter
Remember, you learn by your mistakes.
Respuesta: Command help... -
[CG]Milito - 02.02.2013
GetPlayerName uses 3 parameters
Shall be like this
GetPlayerName(playerid, name, sizeof(name));
Re: Command help... -
Vince - 02.02.2013
Read here:
https://sampwiki.blast.hk/wiki/GetPlayerName
Re: Command help... -
ThePhenix - 02.02.2013
I suggest you to use this function:
PHP код:
stock Name(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
return name;
}
Re: Command help... -
Threshold - 03.02.2013
And yet nobody realises the amount of brackets he has...
pawn Код:
CMD:helpme(playerid, params[])
{
if(PlayerInfo[playerid][LoggedIn])
{
new msg[100];
if(sscanf(params, "s[100]", msg)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: {FFFFFF}/helpme [Message]");
new str[150], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name)); GetPlayerName(playerid, sizeof(playerid));
format(str, sizeof(str), "{00FFFF}[HELP MESSAGE]: %s[%d] {FFFFFF} %s ", name, playerid, msg);
//I assume there should be some form of SendClientMessage here?
}
else SendClientMessage(playerid, COLOR_RED, "You need to be logged in to use this command");
return 1;
}