GRRRRRRRR ZCMD wont work for me -.-
#1

hey i was trying to create a new filterscript but nope not gunna work for some wierd reason as zcmd is really not wanting to work okay so basically i have zcmd.inc so the first code ill give is gunna be

pawn Код:
#include <zcmd>
okay so thats included no errors untill :

pawn Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
CMD:setvip(playerid, params[])
{
    if(PlayerInfo[playerid][pAdminLevel] >= 1 || IsPlayerAdmin(playerid) == 1)
    {
        new id, level;
        if(sscanf(params,"ui", id, level) return SendClientMessage(playerid, -1,"SYNTAX: /setvip [id] [leve]");
        {
            PlayerInfo[id][pVip] = level;
        }
    }
    else SendClientMessage(playerid, -1,"You are not an Admin!");
    return 1;
}
return 0;
}
that should be correct right ?! well no -.- i now get this;

pawn Код:
C:\Users\Admin\Desktop\SAMP\Fas FreeRoam\filterscripts\saving2.pwn(163) : error 029: invalid expression, assumed zero
C:\Users\Admin\Desktop\SAMP\Fas FreeRoam\filterscripts\saving2.pwn(163) : error 017: undefined symbol "cmd_setvip"
C:\Users\Admin\Desktop\SAMP\Fas FreeRoam\filterscripts\saving2.pwn(163) : error 029: invalid expression, assumed zero
C:\Users\Admin\Desktop\SAMP\Fas FreeRoam\filterscripts\saving2.pwn(163) : 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.
its like zcmd isnt even included
Reply
#2

nvm doesnt need the public OnPlayerCommandText
Reply
#3

Do not use it inside the onplayer command text, have it outside functions
Reply
#4

thanks
Reply
#5

okay for some reason its not make the player VIP
pawn Код:
CMD:setvip(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        new id, level;
        if(sscanf(params,"ui", id, level)) return SendClientMessage(playerid, -1,"SYNTAX: /setvip [id] [level]");
        {
            PlayerInfo[id][pVIP] = level;
        }
    }
    else SendClientMessage(playerid, -1,"You are not an Admin!");
    return 1;
}
Reply
#6

Need to check if id == INVALID_PLAYER_ID as sscanf will not cause your message to be sent if the id is not valid.
Reply
#7

um pawn code for this please?
Reply
#8

Well I was hoping you would work it out lol.

pawn Код:
if (id == INVALID_PLAYER_ID) { return SendClientMessage(playerid, -1, "No player online with that id."); }
If an invalid ID is the reason which this message will tell you, use a valid ID lol. Other than that I see no problems.
Reply
#9

pawn Код:
CMD:setvip(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        new id, level;
        if(sscanf(params,"ui", id, level)) return SendClientMessage(playerid, -1,"SYNTAX: /setvip [id] [level]");
        {
            PlayerInfo[id][pVIP] = level;
            if (id == INVALID_PLAYER_ID) { return SendClientMessage(playerid, -1, "No player online with that id."); }
        }
    }
    else SendClientMessage(playerid, -1,"You are not an Admin!");
    return 1;
}
==
Код:
 no motherfukin errors thank you so much man
Reply
#10

yet it didnt work in game -.-
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)