Jump to content

Problema undefined symbol "playerid"


iNTeL.

Recommended Posts

Buna dimineata.

 

De curand mai bine zis de ieri m-am gandit sa incep si eu sa pricep limbajul PAWNO. Am luat gamemod-ul lui Woops si am incercat sa-i bag o comanda , totul a  decurs bine pana la compilare :)). M-am lovit de problema :

Linia :

 

//-----------------------------------------Comanda-----------------------------------------//
    if(strcmp(cmd, "/gotols", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerData[playerid][pAdmin] >= 1 || PlayerData[playerid][pAgent] >= 1)
            {
                if (GetPlayerState(playerid) == 2)
                {
                    new tmpcar = GetPlayerVehicleID(playerid);
                    SetVehiclePos(tmpcar, 1529.6,-1691.2,13.3);
                }
                else
                {
                    SetPlayerPos(playerid, 1529.6,-1691.2,13.3);
                }
                SendClientMessage(playerid, COLOR_WHITE, "Ai fost teleportat cu succes!");
                SetPlayerInterior(playerid,0);
                PlayerData[playerid][pInt] = 0;
                SetPlayerVirtualWorld(playerid, 0);
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, 256, "{C8D4D4}Adm{DB8E12}Warning:{FFFFFF} Admin/Agent %s s-a teleportat. {04DCFD}(/gotols)", sendername);
                ABroadCast(COLOR_LIGHTRED,string,5);
            }
            else
            {
                SendError(playerid,cmd);
            }
         }
        return 1;
    }

Linia 113 : new PlayerData[MAX_PLAYERS][playerid];

C:\Users\Claudiu\Downloads\W3oP\gamemodes\w3op.pwn(113) : error 017: undefined symbol "playerid"
C:\Users\Claudiu\Downloads\W3oP\gamemodes\w3op.pwn(113) : error 009: invalid array size (negative, zero or out of bounds)
C:\Users\Claudiu\Downloads\W3oP\gamemodes\w3op.pwn(1368) : error 017: undefined symbol "sendername"
C:\Users\Claudiu\Downloads\W3oP\gamemodes\w3op.pwn(1368) : error 017: undefined symbol "sendername"
C:\Users\Claudiu\Downloads\W3oP\gamemodes\w3op.pwn(1368) : error 029: invalid expression, assumed zero
C:\Users\Claudiu\Downloads\W3oP\gamemodes\w3op.pwn(1368) : fatal error 107: too many error messages on one line
Edited by iNTeL.
Link to comment
Share on other sites

Pentru linia 113, inainte de new PlayerData[MAX_PLAYERS][playerid]; ai un enum .. { }. Vezi ce scrie imediat dupa cuvantul enum si il pui in loc de playerid de la linia 113.

 

Exemplu:

enum _PINFO
{
  pID,
  pPassword[65]
}
new PlayerData[MAX_PLAYERS][_PINFO];
 
 
Pentru linia 1368, trebuie definit sendername. Pune ce ti-am scris eu mai jos, dupa new-urile de la public OnPlayerCommandText(playerid, cmdtext[]), ca sa nu-l tot definesti la fiecare comanda.
new sendername[MAX_PLAYER_NAME]];
Edited by Punct.

Nu mai deschideti in pu*a mea servere de SA:MP !

Jucati-va pe cele care sunt !   Sunt suficiente !

Reguli de bun simt:

1. Nu faceti reclama unde nu trebuie !

2. Nu injurati ca la usa cortului !

3. Daca esti analfabeti, taci din gura !

4. Nu abuza de 'scuze', 'din greseala' !

 

My work ::: http://pastebin.com/VRNRcaAs

Link to comment
Share on other sites

  • 3 years later...

Iti recomand ZCMD

CMD:gotols(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, COLOR_GRAD1, "   You are not authorized to use that command !");
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            DOO_SetVehiclePos(GetPlayerVehicleID(playerid), 1529.6,-1691.2,13.3);
        }
        else
        {
            DOO_SetPlayerPos(playerid, 1529.6,-1691.2,13.3);
        }
    }
    return 1;
}

Link to comment
Share on other sites

poti face mai simplu

eu recimand sa folosesti zcmd,  #include <zcmd> 

dupa adaugi comanda 

CMD:gotols(playerid){

if(PlayerData[playerid][pAdmin] < 1 && PlayerData[playerid][pAgent] < 1) return SCM(playerid, COLOR_RED, "Nu ai gradul necesar");

SetPlayerPos(playerid, COORDONATELE);

SCM(playerid, COLOR_YELLOW, "Ai fost teleportat in LS");

return 1; }

 

Edited by Edyyy.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.