if(strcmp(cmdtext,"/vcmds",true) == 0)
{
if(IsPlayerVipType(playerid,1)) {
SendClientMessage(playerid,red,"[_____________San Andreas MultiPlayGround VIP Player Commands_____________]");
SendClientMessage(playerid,green,"Silver: /afk, /back, /f - Flips You Car");
if(IsPlayerVipType(playerid,2)) {
SendClientMessage(playerid,green,"Gold: /heal, /armor, /vr - Repairs Your Vehicle");
if(IsPlayerVipType(playerid,3)) {
SendClientMessage(playerid,green,"Preimum: /vpgod,");
}
}
}
else SendClientMessage(playerid,red,"Only Vip's Can Use This Command");
return 1;
}
Originally Posted by SCREENSHOTS
|
YCMD:ahelp(playerid, params[], help)
{
#pragma unused help
#pragma unused params
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
{
switch(PlayerInfo[playerid][pAdmin])
{
case 1: ShowPlayerDialog(playerid, 15, DIALOG_STYLE_MSGBOX, "Admin Komande!", "{00C0FF}/slap /kornjaca /explode /mute /unmute /freeze /unfreeze /crash /kick /ban /goto /gethere /setloc /gotoloc /gotojail /gotokomora /adminbaza /admino /sethp /o /a /getip /specon /specoff /vehid /remove /busi /disarm /onduty /offduty /put /eject", "Ok", "");
case 2: ShowPlayerDialog(playerid, 16, DIALOG_STYLE_MSGBOX, "Admin Komande!", "{00C0FF}/slap /kornjaca /explode /mute /unmute /freeze /unfreeze /crash /jail /unjail /kick /ban /goto /gethere /setloc /gotoloc /gotoammu /gotojail /gotokomora /adminbaza /admino /sethp /settime /givegun /weaponid /o /a /cc /cnn /uping /downing /godmodeon /godmodeoff /visible /getip /specon /specoff /vehid /remove /busi /disarm /onduty /offduty /put /eject", "Ok", "");
case 3: ShowPlayerDialog(playerid, 17, DIALOG_STYLE_MSGBOX, "Admin Komande!", "{00C0FF}/slap /kornjaca /explode /mute /unmute /freeze /unfreeze /crash /jail /unjail /kick /ban /goto /gethere /setloc /gotoloc /gotoammu /gotojail /gotokomora /adminbaza /admino /sethp /setscore /setkills /setdeaths /settime /givegun /weaponid /setmoney /o /a /cc /cnn /cnnn /uping /downing /godmodeon /godmodeoff /visible /getip /specon /specoff /vehid /remove /busi /disarm /onduty /offduty /put", "Ok", "");
}
}
else SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koriљtenje ove komande!");
return 1;
}
At the below reply, it is true you could use the switch statement. However, how much better it would be, with the limited amount of code, is very minimal.
|
i dont think there is a way to do dialogs without doing the case. or is there?
|
if( IsPlayerVIPType( playerid, 1 ) ) ShowPlayerDialog( ... );
else if( IsPlayerVIPType( playerid, 2 ) ) ShowPlayerDialog( ... );
else if( IsPlayerVIPType( playerid, 3 ) ) ShowPlayerDialog( ... );
dude how u will detect which player is vip i want to know only that and always im asking about that how the pawn will detect which player will be vip ? and how i can make to detect some player to give rights ?
|
will IsPlayerVipType return true if you ask for level 1 and he is level 3?
If so then the only way I could improve it would be changing the "Flips You Car" to "Flips Your Car" |