Sendername Problem - 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: Sendername Problem (
/showthread.php?tid=158141)
Sendername Problem -
XtremePlanet - 08.07.2010
Hey,
I'm trying to create a clan system, it got bad at /creataclan command.
Here's a bit of the code, where the sendername jumps in.
pawn Код:
if(strcmp(cmdtext, "/createclan", true) == 0)
{
if(playerclan[playerid] != 99) return SendClientMessage(playerid,COLOR_ORANGE,"You're already in a Clan!");
new reason[10];
new cid = 99;
format(reason,sizeof(reason),"%s",bigstrtok(cmdtext, idx));
if(!strlen(reason))
{
SendClientMessage(playerid, COLOR_ORANGE, "/creatclan [clan name]");
return 1;
}
for(new i = 9; i > -1; i--)
{
if (strcmp(clannames[i]," ",true) == 0 || !strlen(clannames[i])) cid = i;
}
if (cid == 99) return SendClientMessage(playerid,COLOR_ORANGE,"There are too many clans on the server!");
GetPlayerName(playerid, sendername, sizeof(sendername));
playerclan[playerid] = cid;
format(clannames[cid],10,"%s",reason);
format(string, sizeof(string), "You have succesfully creat clan - %s",clannames[cid]);
SendClientMessage(playerid,CLANTEXT, string);
clanjoin[playerid] = 1;
return 1;
}
The point is, I get "undefined symbol: "sendername".
I placed new sendername[MAX_PLAYERS];, new sendername[MAX_PLAYER_NAME]; all around the script, right below the OnPlayerCommandText, top of the script, in the command. It always happens.
Does anyone know what to do? Thanks.
Re: Sendername Problem -
Hiddos - 08.07.2010
Tried placing it before you first needed it?
pawn Код:
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid,sendername,sizeof sendername);
Re: Sendername Problem -
XtremePlanet - 08.07.2010
Thanks, tried it all the time, but aint' working.