PDA

View Full Version : not allowed to use command..


IndependentGaming
14/10/2015, 12:19 PM
hello, i got a command


CMD:houseedit(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1338 && PlayerInfo[playerid][pHouseModerator] >= 1)


if im admin 1338 or higher i can use it, but if im a HouseModerator it says you are not allowed to use this command how is that ? if i change the && to || got the same problem


ps there is just 1 housemoderator level can i change the >= to == 1 ?

Sawalha
14/10/2015, 12:21 PM
if it's only one value for housemoderator variable why do you use >= then? try ==

IndependentGaming
14/10/2015, 12:25 PM
Alright i will try that
what about this command you need atleast be level 1 VIP to use this command:


CMD:vshop(playerid, params[])
{
if(PlayerInfo[playerid][pDonateRank] >= 1)
{
SendClientMessageEx(playerid, COLOR_GRAD2, " You must be a VIP to use this command!");
return 1;
}


But when i set my vip to 1 or higher, it saying the text you see there "You must be a VIP to use this command!"

jlalt
14/10/2015, 12:39 PM
CMD:vshop(playerid, params[])
{
if(PlayerInfo[playerid][pDonateRank] >= 1) {
// your code here like:
SendClientMessageEx(playerid, COLOR_GRAD2, " Hey Dude!");
} else return SendClientMessageEx(playerid, COLOR_GRAD2, " You must be a VIP to use this command!");
return 1;
}

you have to use else to check if player ain't have vip 1 or above

bgedition
14/10/2015, 12:43 PM
First you need to search and if and only if you didn't find a solution, you may post here.
Take a look at this
http://wiki.sa-mp.com/wiki/Control_Structures#Operators