I Have a Problem
#1

In My Server,I Added /checkvip To Check If A Player Is Vip But It Doesnt Work In:

dcmd_checkvip(playerid,params[]) {
new id=strval(params);
if(!strlen(params) || !IsNumeric(params)) {
return SendClientMessage(playerid,red,"USAGE: /checkvip [playerid]");
}
else if(!IsPlayerConnected(id)) {
return SendClientMessage(playerid,red,"The Player is not connected");
}
else if(IsPlayerConnected(id)){
if(IsPlayerVipType(id,1))
{
new name[MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name));
format(string,sizeof(string),"%s (%i) Is A Vip Member.", name,playerid);
}
}
else
{
new name[MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name));
format(string,sizeof(string),"%s (%i) Isn't A Vip Member.", name,playerid);
}
return 1;
}

I need help in This Problem.
Reply
#2

What doesn't work exactly? You get any messages after typing command?
Reply
#3

pawn Код:
if(IsPlayerVipType(id,1))
to
pawn Код:
if(IsPlayerVipType(id == 1))
??

You don't have any detail on what's not working??
Reply
#4

I dont get messages when i try to use the CMD
Reply
#5

Quote:
Originally Posted by itsCody
Посмотреть сообщение
pawn Код:
if(IsPlayerVipType(id,1))
to
pawn Код:
if(IsPlayerVipType(id == 1))
??

You don't have any detail on what's not working??
I don't know what IsPlayerVipType definition is, but in any case it won't work, because you are checking is given player id equals 1, which means, function would work only then, when targetid is 1.

Quote:
Originally Posted by Youssef214
Посмотреть сообщение
I dont get messages when i try to use the CMD
You forgot to add SendClientMessage, so you don't get any message.
pawn Код:
dcmd_checkvip(playerid,params[])
{
    new id=strval(params);
    if(!strlen(params) || !IsNumeric(params))
    {
        return SendClientMessage(playerid,red,"USAGE: /checkvip [playerid]");
    }
    else if(!IsPlayerConnected(id))
    {
        return SendClientMessage(playerid,red,"The Player is not connected");
    }
    else if(IsPlayerConnected(id))
    {
        if(IsPlayerVipType(id,1))
        {
            new name[MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1];
            GetPlayerName(playerid, name, sizeof(name));
            format(string,sizeof(string),"%s (%i) Is A Vip Member.", name,playerid);
            SendClientMessage(playerid, red, string);
        }
        else
        {
            return SendClientMessage(playerid, red, "Player is not a VIP member (probably)");
        }
    }
    else
    {
        new name[MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1];
        GetPlayerName(playerid, name, sizeof(name));
        format(string,sizeof(string),"%s (%i) Isn't A Vip Member.", name,playerid);
        SendClientMessage(playerid, red, string);
    }
    return 1;
}
Reply
#6

You dont understand IsPlayerVipType(playerid, 1) it checks if the type of the vip is 1 or more in my server,i want it to send me a message if the player is vip or not
Reply
#7

Can you show me IsPlayerVipType function?
Reply
#8

Thank you for the script it works
Reply
#9

IsPlayerVipType(playerid, 1= Sliver Account - 2= Gold Account - 3= Perimum Account),You can understand how this function can work in my server (41.191.58.135), i dont mean to advertise
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)