SA-MP Forums Archive
I Have a Problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: I Have a Problem (/showthread.php?tid=489793)



I Have a Problem - Youssef214 - 24.01.2014

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.


Re: I Have a Problem - Scottas - 24.01.2014

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


Re: I Have a Problem - itsCody - 24.01.2014

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

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


Re: I Have a Problem - Youssef214 - 24.01.2014

I dont get messages when i try to use the CMD


Re: I Have a Problem - Scottas - 24.01.2014

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



Re: I Have a Problem - Youssef214 - 24.01.2014

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


Re: I Have a Problem - Scottas - 24.01.2014

Can you show me IsPlayerVipType function?


Re: I Have a Problem - Youssef214 - 24.01.2014

Thank you for the script it works


Re: I Have a Problem - Youssef214 - 24.01.2014

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