Jump to content

Recommended Posts

Posted (edited)

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.
Posted (edited)

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

  • 3 years later...
Posted

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;
}

Posted (edited)

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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.