/vr Command
#1

Quote:

if(strcmp(cmd, "/vr", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 1337)
{
SendClientMessage(playerid, COLOR_GRAD1, "** you are not authorized to use that command!");
return 1;
}
if(IsPlayerInAnyVehicle(playerid))
{
RepairVehicle(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, COLOR_GREY, "** Vehicle Fixed !");
format(string, sizeof(string), "[ADMIN]: %s has Fixed His Car", sendername);
ABroadCast(COLOR_LIGHTRED, string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Repaired His Vehicle.",d,m,y,h,mi,s,sendername);
AdminLog(string);
}
}
return 1;
}

This is the /vr command i want admins level 6, 1337 and 1338 only to use it.
Reply
#2

Next time please you pawn tags:
pawn Код:
if(strcmp(cmd, "/vr", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] == 1337 || 6 || 1338)
{
SendClientMessage(playerid, COLOR_GRAD1, "** you are not authorized to use that command!");
return 1;
}
if(IsPlayerInAnyVehicle(playerid))
{
RepairVehicle(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, COLOR_GREY, "** Vehicle Fixed !");
format(string, sizeof(string), "[ADMIN]: %s has Fixed His Car", sendername);
ABroadCast(COLOR_LIGHTRED, string, 5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Repaired His Vehicle.",d,m,y,h,mi,s,sendername);
AdminLog(string);
}
}
return 1;
}
I added this "||" symbol, this means 'or' and also added this "==" symbol, this means 'equal to'.
Reply
#3

Thanks =D
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)