VIP COMMANDS - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: VIP COMMANDS (
/showthread.php?tid=150374)
VIP COMMANDS -
dee10 - 25.05.2010
hi im dee10 and i have a few commands for vip but i want to make it where only vips can use that command instead of anyone else please tell me how?!
Re: VIP COMMANDS -
Las Venturas CNR - 26.05.2010
Use something in the command like
pawn Код:
if(VipPlayer[playerid] == 1)
Re: VIP COMMANDS -
-Rebel Son- - 26.05.2010
What he said. so make it like..
for example.
pawn Код:
if(!strcmp(cmdtext,"/bacon",true)) {
vip[playerid] == 1)
{
SendClientMessage(playerid,color,"mmmh tasty bacon for the vip!");
}
else
{
SendClientMessage(playerid,color,"No bacon for you");
}
return 1;}
Re: VIP COMMANDS -
shady91 - 26.05.2010
Quote:
|
Originally Posted by _Ч§hмf†ҐЧ™_
What he said. so make it like..
for example.
pawn Код:
if(!strcmp(cmdtext,"/bacon",true)) { vip[playerid] == 1) { SendClientMessage(playerid,color,"mmmh tasty bacon for the vip!"); } else { SendClientMessage(playerid,color,"No bacon for you"); } return 1;}
|
that's wrong
I would do something like
pawn Код:
// this is ZCMD cause it's how I'm used to writing cmds
cmd(donator, playerid, parmas[])
{
if(GetPVarInt(playerid, "Donator") == 0) return SendClientMessage(playerid, color, "You aint a donator.");
if(GetPVarInt(playerid, "Donator") == 1)return SendClientMessage(playerid, color, "You are a donator.");
return 1;
}
// this is just a little example of how I would do it.
Re: VIP COMMANDS -
-Rebel Son- - 26.05.2010
Yeah i guess you could do it that way. but then you would have to set the Pvar on setting donator status right?
Re: VIP COMMANDS -
shady91 - 26.05.2010
Quote:
|
Originally Posted by _Ч§hмf†ҐЧ™_
Yeah i guess you could do it that way. but then you would have to set the Pvar on setting donator status right?
|
just make it save and set when a player logs in.
Re: VIP COMMANDS -
NiiRV4N4 - 26.05.2010
Quote:
|
Originally Posted by _Ч§hмf†ҐЧ™_
What he said. so make it like..
for example.
pawn Код:
if(!strcmp(cmdtext,"/bacon",true)) { vip[playerid] == 1) { SendClientMessage(playerid,color,"mmmh tasty bacon for the vip!"); } else { SendClientMessage(playerid,color,"No bacon for you"); } return 1;}
|
This is much easier than Shady91's way.
Re: VIP COMMANDS -
shady91 - 26.05.2010
Quote:
|
Originally Posted by NiiRV4N4
Quote:
|
Originally Posted by _Ч§hмf†ҐЧ™_
What he said. so make it like..
for example.
pawn Код:
if(!strcmp(cmdtext,"/bacon",true)) { vip[playerid] == 1) { SendClientMessage(playerid,color,"mmmh tasty bacon for the vip!"); } else { SendClientMessage(playerid,color,"No bacon for you"); } return 1;}
|
This is much easier than Shady91's way.
|
No it's not. Plus that code look's wrong.
pawn Код:
if(!strcmp(cmdtext,"/bacon",true))
{
if(vip[playerid] == 1)
{
SendClientMessage(playerid,color,"mmmh tasty bacon for the vip!");
}
else
{
SendClientMessage(playerid,color,"No bacon for you");
}
return 1;
}
I would recommend Pvar's it's allot better.
Re: VIP COMMANDS -
Jakku - 26.05.2010
pawn Код:
if(!strcmp(cmdtext,"/cmd",true)) {
if (IsPlayerVip[playerid] == 1) { //Change the variable IsPlayerVip to your own
//If player is VIP, all functions here happens.
}
}
return 1;
Re: VIP COMMANDS -
shady91 - 26.05.2010
Quote:
|
Originally Posted by Jakku
pawn Код:
if(!strcmp(cmdtext,"/cmd",true)) { if (IsPlayerVip[playerid] == 1) { //Change the variable IsPlayerVip to your own //If player is VIP, all functions here happens. }
} return 1;
|
Why did you post that, like he don't have enough example's?