Whats the different between this two functions?
#1

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?
Reply
#2

Tried to replace i with playerid?
The other is the same thing, i prefer using sizeof(string) since its easier in big codes.
Reply
#3

pawn Код:
format(string, sizeof(string), "*** %s %s *** %s", arank, PlayerInfo[playerid][pAdmName], result);
Reply
#4

thanks it does work. so PlayerInfo[playerid][pAdmName] is Same as sendername?
Reply
#5

If sendername gets the player name from playerid then yes
Reply
#6

But why i get this wrong?

Quote:

GetPlayerInfo(playerid, pAdmName, sizeof(sendername));

Unsymbol Getplayerinfo. I forgot what should i use for this functions??
Reply
#7

GetPlayerName?
Reply
#8

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(giveplayeridgiveplayersizeof(giveplayer)); 
            
GetPlayerName(playeridpAdmNamesizeof(sendername)); // This is the line 16367
            
if(PlayerInfo[playerid][pAdmin] == 11) { sendername "Hidden Admin"; }
            
format(string256"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.
Reply
#9

how have you defined pAdmName? it should be a string
Reply
#10

Yes i did. Only changing it i dont know. its been define already.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)