Make VIP command only? -
Eminem 2ka9 - 08.12.2012
I wanna make /laseron a VIP only command. This is an example of a VIP feature, how do i make vip only commands tho? thanks...
Код:
if(PlayerInfo[playerid][pVIP] > 0)
{
new Float:armour, level;
GetPlayerArmour(playerid, armour);
level = PlayerInfo[playerid][pVIP];
switch(level)
{
case 1:
{
SetPlayerArmour(playerid, 50.0);
SendClientMessage(playerid, C_GREY, "** VIP armour added!");
}
case 2:
{
SetPlayerArmour(playerid, 99);
SendClientMessage(playerid, C_GREY, "** VIP armour added!");
}
case 3:
{
SetPlayerArmour(playerid, 99);
SendClientMessage(playerid, C_GREY, "** VIP armour added!");
}
}
}
SetRank3DText(playerid);
}
else
{
TogglePlayerControllable(playerid, 0);
SetPlayerClass(playerid);
}
return 1;
}
Re: Make VIP command only? -
Ironboy - 08.12.2012
This is the way of making a specified command for VIP
pawn Код:
CMD:laseron(playerid,params[]){
#pragma unused params
if(PlayerInfo[playerid][pVIP] >= 1)
{
//codes
}
else
{
SendClientMessage(playerid,-1,"Sorry, you are not a VIP and cannot use this feature.");
}
return 1;}
Re: Make VIP command only? -
Eminem 2ka9 - 09.12.2012
I used this code:
Код:
CMD:laseron(playerid, params[])
{
if(PlayerInfo[playerid][pVIP] > 1)
{
SetPVarInt(playerid, "laser", 1);
SetPVarInt(playerid, "color", GetPVarInt(playerid, "color"));
else
{
SendClientMessage(playerid,-1,"Sorry, you are not a VIP and cannot use this feature.");
}
return 1;}
}
But I get 1 error and 1 warning:
Код:
C:\Users\tommy\Desktop\Battlefield Server 1.8\gamemodes\battlefield.pwn(4148) : error 029: invalid expression, assumed zero
C:\Users\tommy\Desktop\Battlefield Server 1.8\gamemodes\battlefield.pwn(4153) : warning 209: function "cmd_laseron" should return a value
Re: Make VIP command only? -
Randy More - 09.12.2012
pawn Код:
CMD:laseron(playerid,params[])
{
#pragma unused params
if(PlayerInfo[playerid][pVIP] < 1) return SendClientMessage(playerid, -1,"This command is restricted for the VIPs only.");
SetPVarInt(playerid, "laser", 1);
SetPVarInt(playerid, "color", GetPVarInt(playerid, "color"));
return 1;
}
Re: Make VIP command only? -
Baumann - 10.12.2012
C:\Documents and Settings\S0n\Desktop\vip.pwn(9) : warning 203: symbol is never used: "laseron"
C:\Documents and Settings\S0n\Desktop\vip.pwn(9) : error 013: no entry point (no public functions)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
Re: Make VIP command only? -
tsonn1 - 10.12.2012
U don't need pragma unused params with ZCMD, it's only needed for dcmd.
Re: Make VIP command only? -
niels44 - 10.12.2012
mate, if it says symbol is never used: laseron, then i think you havent got the zcmd include right?
do you have on top of your script:
?
and do you also actaully HAVE the include in your includes folder?
also use [code.] and [/code.] with out the .

, so you can put the things like i did in a special part of your text.
greets niels