Whats the different between this two functions? -
jaami - 23.03.2012
I got error from this line
Quote:
format(string, sizeof(string), "*** %s %s *** %s", arank, PlayerInfo[pAdmName], result);
|
i got this error (20292) : error 032: array index out of bounds (variable "PlayerInfo")
I tried to put PlayerInfo[i][pAdmName] but still get another different error which is (20292) : error 017: undefined symbol "i"
Any solutions please.
And i got question, where i get confuse.
Whats the different between this
Quote:
format(string, sizeof(string), "*** %s %s *** %s", Bla, Bla, result);
|
And This
Quote:
format(string, 256, ***: %s (%s): %s*** [ID: %d] ", bla, bla], bla, i);
|
Mind telling me? format(string, 256, blablabla); and format(string,sizeof(string), "blablabla); give the same thing. but why the functions is different?
Re: Whats the different between this two functions? -
Richie© - 23.03.2012
Tried to replace i with playerid?
The other is the same thing, i prefer using sizeof(string) since its easier in big codes.
Re: Whats the different between this two functions? -
Daddy Yankee - 23.03.2012
pawn Код:
format(string, sizeof(string), "*** %s %s *** %s", arank, PlayerInfo[playerid][pAdmName], result);
Re: Whats the different between this two functions? -
jaami - 23.03.2012
thanks it does work. so PlayerInfo[playerid][pAdmName] is Same as sendername?
Re: Whats the different between this two functions? -
Daddy Yankee - 23.03.2012
If sendername gets the player name from playerid then yes
Re: Whats the different between this two functions? -
jaami - 23.03.2012
But why i get this wrong?
Quote:
GetPlayerInfo(playerid, pAdmName, sizeof(sendername));
|
Unsymbol Getplayerinfo. I forgot what should i use for this functions??
Re: Whats the different between this two functions? -
emokidx - 23.03.2012
GetPlayerName?
Re: Whats the different between this two functions? -
jaami - 23.03.2012
I get this error
(16367) : error 035: argument type mismatch (argument 2)
(16367) : error 035: argument type mismatch (argument 2)
PHP код:
if(strcmp(cmd,"/banip",true)==0)
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_GRAD1,"USAGE: /banip [players ip]");
return 1;
}
format(string,sizeof(string),"banip %s",tmp);
SendRconCommand(string);
SendRconCommand("reloadbans");
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, pAdmName, sizeof(sendername)); // This is the line 16367
if(PlayerInfo[playerid][pAdmin] == 11) { sendername = "Hidden Admin"; }
format(string, 256, "AdmWarning: %s has banned IP %s", sendername,tmp);
ABroadCast(COLOR_YELLOW,string,1);
}
return 1;
}
This is rp script, im trying to make when player get ban it says like this
Trying ti change it.
AdmWarning: Tyler_Hudson has banned IP Alex_Patrov
To this
AdmWarning: Jaami has banned IP Alex_Patrov
Using the pAdmName not the character name.
Re: Whats the different between this two functions? -
emokidx - 23.03.2012
how have you defined pAdmName? it should be a string
Re: Whats the different between this two functions? -
jaami - 23.03.2012
Yes i did. Only changing it i dont know. its been define already.