help with a command i have 1 error - 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: help with a command i have 1 error (
/showthread.php?tid=279922)
help with a command i have 1 error -
boyan96 - 29.08.2011
this is the command
PHP код:
if(strcmp(cmd, "/setworld", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /setvw [playerid/PartOfName] [virworldid]");
return 1;
}
new playa;
playa = ReturnUser(tmp);
new virid;
tmp = strtok(cmdtext, idx);
virid = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
SetPlayerVirtualWorld(playa, virid);
format(string, sizeof(string), " You have set %s virtual world to %d.", giveplayer, virid);
SendClientMessage(playerid, COLOR_GRAD1, string);
format(string, sizeof(string), " %s have set your virtual world to %d.", sendername, virid);
SendClientMessage(playa, COLOR_GRAD1, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command!");
}
}
return 1;
}
i have this errorr
(6747) : error 017: undefined symbol "sendername" ==>>> GetPlayerName(playerid, sendername, sizeof(sendername));
Re: help with a command i have 1 error -
=WoR=G4M3Ov3r - 29.08.2011
PHP код:
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "users/%s.ini", sendername);
Re: help with a command i have 1 error -
boyan96 - 29.08.2011
i have this warnings
(8660) : warning 219: local variable "sendername" shadows a variable at a preceding level
(8674) : warning 219: local variable "sendername" shadows a variable at a preceding level
(10761) : warning 219: local variable "sendername" shadows a variable at a preceding level
(10951) : warning 219: local variable "sendername" shadows a variable at a preceding level
Re: help with a command i have 1 error -
=WoR=Varth - 29.08.2011
Oh my gosh
http://forum.sa-mp.com/showpost.php?...33&postcount=8
Re: help with a command i have 1 error -
=WoR=G4M3Ov3r - 29.08.2011
Quote:
Originally Posted by varthshenon
|
Lol, He's using Strcmp
Re: help with a command i have 1 error -
=WoR=Varth - 29.08.2011
Quote:
Originally Posted by G4M3Ov3r
Lol, He's using Strcmp
|
How can I know?
Anyway I mean he didn't need to create another topic.