VIP help
#1

Fixed
Reply
#2

What's the string/integer that checks if a player is VIP?
I use always eg. PlayerInfo[playerid][pVip]
Reply
#3

if(PlayerInfo[playerid][pDonateRank] >= 1)

Edit;

I searched trough the script and found something. Could I make a "IsAVip", and make something like this.


Quote:

else if(IsPlayerInRangeOfPoint(playerid, 3.0, 246.5112,87.4867,1003.6406)) //LSPD-Garage Exit
{
if(IsACop(playerid))
{
SetPlayerPos(playerid,1568.5718,-1691.0177,5.8906);
SetPlayerFacingAngle(playerid, 180.0000);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 0);
PlayerInfo[playerid][pInt] = 0;

Making an IsAVIP instead of IsACOP.
Reply
#4

I get this error.
Quote:
* error 029: invalid expression, assumed zero
By this code.
Quote:

public IsAVip(playerid)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pDonateRank] >= 1)
}
}
return 0;

What's wrong?
Thanks!
Reply
#5

Okay, I fixed it, but I still get a dousin of errors when i'm trying to add it to the /enter command..

Quote:

else if(IsPlayerInRangeOfPoint(playerid,8.0,1797.4569,-1578.9788,14.085)
{
if(IsAVip(playerid))
{
SetPlayerInterior(playerid,7);
SetPlayerPos(playerid,773.579956,-77.096694,1000.655029);
GameTextForPlayer(playerid, "~w~VIP", 5000, 1);
PlayerInfo[playerid][pInt] = 14;

Reply
#6

Anyone?
Reply
#7

use [ pawn ] [ /pawn ] or upload to pastebin so we can see the code.
Reply
#8

It would be nice if you post the warnings / errors.
And here's a better 'IsAVip':

pawn Код:
stock IsAVip(playerid, reqlevel = 1)
    PlayerInfo[playerid][pDonateRank] >= reqlevel ? true : false;
You can use it like this:
IsAVip(playerid); - Just check if he's at least VIP level 1 (so if he's a VIP)
But you can also check his level then:
IsAVip(playerid, 2); - With that, it'll only work for people with VIP level 2 and higher
Reply
#9

Thanks!!
Reply
#10

Also, by the way, how can I make this only enterable for VIPs?


pawn Код:
}
            else if(IsPlayerInRangeOfPoint(playerid,8.0,1797.4569,-1578.9788,14.0858))
                  {
                SetPlayerInterior(playerid,7);
                SetPlayerPos(playerid,773.579956,-77.096694,1000.655029);
                GameTextForPlayer(playerid, "~w~VIP", 5000, 1);
                PlayerInfo[playerid][pInt] = 14;
            }
Reply
#11

Also, is this right?

pawn Код:
public IsAVip(playerid)
{
    if(IsPlayerConnected(playerid))
    {
     PlayerInfo[playerid][pDonateRank] >= reqlevel ? true : false;
  {
            return 1;
        }
        else if(PlayerInfo[playerid][pLevel] > 1)
        {
            return 1;
  }
    }
    return 0;
I'm a beginner.. You see.
Reply
#12

Ehm that stock IsAVip(playerid) (no forward needed) I made was actually already good.
pawn Код:
stock IsAVip(playerid, reqlevel = 1)
    PlayerInfo[playerid][pDonateRank] >= reqlevel ? true : false;
And here's a little command with ZCMD about that thing you posted

pawn Код:
CMD:entervip(playerid, params[])
{
    if(!IsAVip(playerid)) return 0;
    if(!IsPlayerInRangeOfPoint(playerid, 8, 1797.4569, -1578.9788, 14.0858)) return 0;
    SetPlayerInterior(playerid, 7);
    SetPlayerPos(playerid, 773.579956, -77.096694, 1000.655029);
    GameTextForPlayer(playerid, "~w~VIP", 5000, 1);
    PlayerInfo[playerid][pInt] = 14;
    return 1;
}
And you can change the 'return 0;' with 'return SendClientMessage(playerid, 0xFF0000AA, "Message");'. Change "Message" with the message you wanna show (eg. "Vips only!" and "You're not near the entrance!")
Reply
#13

Thanks, but still..
Where am I supposed to add this?

pawn Код:
stock IsAVip(playerid, reqlevel = 1)
    PlayerInfo[playerid][pDonateRank] >= reqlevel ? true : false;
Reply
#14

You had made that function "public IsAVip(playerid)" right? Remove that one and then just add this (eg. on the place of your script).
Reply
#15

pawn Код:
C:\Users\Hjem\Desktop\C**P\GameModes\****.pwn(3582) : error 010: invalid function or declaration
C:\Users\Hjem\Desktop\C**P\GameModes\****.pwn(3584) : error 010: invalid function or declaration
C:\Users\Hjem\Desktop\C**P\GameModes\****.pwn(3587) : error 010: invalid function or declaration
C:\Users\Hjem\Desktop\C**P\GameModes\****.pwn(3590) : error 010: invalid function or declaration
pawn Код:
}
    stock IsAVip(playerid, reqlevel = 1)
    PlayerInfo[playerid][pDonateRank] >= reqlevel ? true : false;)
{
    if(IsPlayerConnected(playerid))
    {
        {
            return 1;
        }
    }
    return 0;
Reply
#16

I have no idea where exatly to add it, because I removed my old isavip thing, and when I add that, I get like 5 errors..
Reply
#17

Why do you add this:
pawn Код:
{
    if(IsPlayerConnected(playerid))
    {
        {
            return 1;
        }
    }
    return 0;
That's not needed like I said. That function I said whas the complete function. Do NOT add it in a command or something. Here's an example gamemode:

pawn Код:
#include <a_samp>
#include <zcmd>

enum pInfo
{
    pDonateRank
};
new PlayerInfo[MAX_PLAYERS][pInfo];

main()
    return 1;

public OnGameModeInit()
    return 1;

stock IsAVip(playerid, reqlvl = 1)
    return PlayerInfo[playerid][pDonateRank] >= reqlvl ? true : false;

CMD:vip(playerid, params[])
{
    if(IsAVip(playerid))
        SendClientMessage(playerid, 0xFFFFFFAA, "You are a VIP!");
    else if(IsAVip(playerid, 2))
        SendClientMessage(playerid, 0x00FF00AA, "You are a VIP level 2!");
    else if(IsAVip(playerid, 3))
        SendClientMessage(playerid, 0x00FF00AA, "** You are a VIP level 3!");
   
    if(!IsAVip(playerid))
        SendClientMessage(playerid, 0xFF0000AA, "You are not a VIP");
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)