25.05.2010, 23:40
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?!
if(VipPlayer[playerid] == 1)
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;}
|
Originally Posted by _Ч§hмf†ҐЧ™_
What he said. so make it like..
for example. 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.
|
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?
|
|
Originally Posted by _Ч§hмf†ҐЧ™_
What he said. so make it like..
for example. pawn Код:
|
|
Originally Posted by NiiRV4N4
Quote:
|
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;
}
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;
|
Originally Posted by Jakku
pawn Код:
|