Can someone help?
#1

Hello guys. I have a filterscript which spawns cars. I wish to make the command admin only. The script is as follows:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp(cmdtext, "/burnsycar", true))
    {
        ShowPlayerDialog(playerid, Dialog, DIALOG_STYLE_LIST, "Car spawner", "Infernus\nTurismo\nPhoenix\nCheetah\nBanshee\nEuros\nBuffalo\nKart\nHotknife\nHustler\nComet\nStallion\nSunrise\nSandking", "Spawn", "Cancel");
        return 1;
    }
    return 0;
}
In my gamemode we define admins as the follows:

pawn Код:
if( Player[playerid][AdminLevel] >= 1 && Player[playerid][AdminDuty] > 0 )
Can someone tell me where to stick it in the script without getting errors like the below?

pawn Код:
C:\Users\Robert\Desktop\Grand Theft Auto San Andreas NEW\server\filterscripts\spawner.pwn(25) : error 017: undefined symbol "Player"
C:\Users\Robert\Desktop\Grand Theft Auto San Andreas NEW\server\filterscripts\spawner.pwn(25) : warning 215: expression has no effect
C:\Users\Robert\Desktop\Grand Theft Auto San Andreas NEW\server\filterscripts\spawner.pwn(25) : error 001: expected token: ";", but found "]"
C:\Users\Robert\Desktop\Grand Theft Auto San Andreas NEW\server\filterscripts\spawner.pwn(25) : error 029: invalid expression, assumed zero
C:\Users\Robert\Desktop\Grand Theft Auto San Andreas NEW\server\filterscripts\spawner.pwn(25) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Thanks, Robert.
Reply
#2

The enum is not called "Player" are you sure its not "PlayerInfo"? ( i am assuming you are using Godfather, i apologize if you are not)
Reply
#3

I think it's PlayerInfo or pInfo.
Reply
#4

Quote:
Originally Posted by bartje01
Посмотреть сообщение
I think it's PlayerInfo or pInfo.
It will be whatever he named it...

He needs to check where the enum was made, if it is GF its likely to be PlayerInfo, although if its not he is likely to be different.
Reply
#5

Quote:
Originally Posted by DarrenThayer
Посмотреть сообщение
It will be whatever he named it...

He needs to check where the enum was made, if it is GF its likely to be PlayerInfo, although if its not he is likely to be different.
I'm not sure if he made his GM though
Reply
#6

Quote:
Originally Posted by bartje01
Посмотреть сообщение
I'm not sure if he made his GM though
hence my " ( i am assuming you are using Godfather, i apologize if you are not)"
Reply
#7

When you do sort out your variables you would want something like this,
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp(cmdtext, "/burnsycar", true))
    {
        if( Player[playerid][AdminLevel] > 0 && Player[playerid][AdminDuty] > 0 )//change for the proper variable.
        {
            ShowPlayerDialog(playerid, Dialog, DIALOG_STYLE_LIST, "Car spawner", "Infernus\nTurismo\nPhoenix\nCheetah\nBanshee\nEuros\nBuffalo\nKart\nHotknife\nHustler\nComet\nStallion\nSunrise\nSandking", "Spawn", "Cancel");
            return 1;
        }
        else return 0;//or send a message "you're not admin F**k OFF! (or something along those lines)
    }
    return 0;
}
Reply
#8

Thanks for all your replies, I'm not using GF.

In my command for kick, I have the following,

pawn Код:
{
    new id, reason[128], string[ 128 ];
    if( sscanf( params, "us", id, reason) )
    {
        if( Player[playerid][AdminLevel] >= 1 && Player[playerid][AdminDuty] > 0 )
        {
            SendClientMessage( playerid, INFO_GREY, "SYNTAX: /kick <playerid/name> <reason>"  );
        }
    }
So does this mean I should be using Player?
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)