SA-MP Forums Archive
Donator class rep++ - 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: Donator class rep++ (/showthread.php?tid=568597)



Donator class rep++ - Mijata - 23.03.2015

how to add team donator only for donators/vips

if(pInfo[playerid][Donator] == 1 && pInfo[playerid][Donator] == 0)
{
SendClientMessage(playerid, RED, "You need to be vip for donator team");
return 0;
}
return 1;
}



this team
Код:
              case 12:
                    {
              	GameTextForPlayer(playerid,"~w~VIP ONLY",1000,6);
                SetPlayerColor(playerid, C_COLOR);
                gTeam[playerid] = C1;
                SetPlayerPos(playerid,-285.0289,2661.6575,62.6531);
                SetPlayerCameraPos(playerid,-279.0844,2660.7461,62.6090);
                SetPlayerCameraLookAt(playerid,-285.0289,2661.6575,62.6531);
                SetPlayerFacingAngle(playerid,271.5169);
            }
    }



Re: Donator class rep++ - arjanforgames - 23.03.2015

You are checking if donator is equal 1 but also if its equal to 0.

Use:
Код:
if(pInfo[playerid][Donator] == 0)
{
SendClientMessage(playerid, RED, "You need to be vip for donator team");
return 0;
}
return 1;
}



Re: Donator class rep++ - MrCallum - 23.03.2015

Quote:
Originally Posted by arjanforgames
Посмотреть сообщение
You are checking if donator is equal 1 but also if its equal to 0.

Use:
Код:
if(pInfo[playerid][Donator] == 0)
{
SendClientMessage(playerid, RED, "You need to be vip for donator team");
return 0;
}
return 1;
}
Arjanforgames is right, you are saying that donators and non donators cannot use this class so the code above should work for you.

My pre-custom made code for you.

Код:
if(PlayerInfo[playerid][Donator] == 0) // Or: if(pInfo[playerid][Donator] == 0)
{
SendClientMessage(playerid, COLOR_RED, "You need to be a V.I.P to be eligible for the donator team!");
return 0;
}
return 1;
}



Re: Donator class rep++ - CalvinC - 23.03.2015

Why make a new code containing PlayerInfo and COLOR_RED when he's using pInfo and RED?
Just do what arjanforgames said.


Re: Donator class rep++ - MrCallum - 23.03.2015

Well, some people may wan't to use it and might see this post and might see my code, so they could use it for future reference, and plus, I did do // Or ....

EDIT: Plus, I'm trying to help, at least i'm trying to do something instead of sitting on my ass and doing nothing.