SA-MP Forums Archive
/vr Command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /vr Command (/showthread.php?tid=400350)



/vr Command - WiseRice - 18.12.2012

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.


Re: /vr Command - Faisal_khan - 18.12.2012

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'.


Re: /vr Command - WiseRice - 18.12.2012

Thanks =D