11.06.2013, 19:35
Hello,
I got /stuck command that let you unfreeze if you are stuck .
The problem is that when im not in rental vehicle , it shows me you are in rental vehicle .
Im not good scripter i just started learning .
i made the rental and sale lines . Sale works good but rental works when im on foot too .
PS.:I use Raven's RP as gamemode
here is the code :
I got /stuck command that let you unfreeze if you are stuck .
The problem is that when im not in rental vehicle , it shows me you are in rental vehicle .
Im not good scripter i just started learning .
i made the rental and sale lines . Sale works good but rental works when im on foot too .
PS.:I use Raven's RP as gamemode
here is the code :
pawn Код:
if(strcmp(cmd, "/stuck", true) == 0) // By CuervO_NegrO
{
if(IsPlayerConnected(playerid))
{
new carid = GetPlayerVehicleID(playerid);
new vehicleid = GetPlayerVehicleID(playerid);
if(PlayerInfo[playerid][pFrozen] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "You were frozen by an admin, you can't evade that!");
SendClientMessage(playerid, COLOR_GREY, "If you still think that you are bugged use /atalk!");
return 1;
}
if(admins >= 1 && PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessage(playerid, COLOR_GREY, "There are administrators online, please use /atalk!");
return 1;
}
if(IsASalesVehicle(vehicleid))
{
SendClientMessage(playerid, COLOR_GREY, "You are in a sale vehicle. do /exit or use /atalk!");
return 1;
}
if(IsARentableVeh(carid))
{
SendClientMessage(playerid, COLOR_GREY, "You are in a rental vehicle. do /exit or use /atalk!");
return 1;
}
TogglePlayerControllable(playerid, 1);
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 [CMD] -> /stuck",d,m,y,h,mi,s,sendername);
AdminLog(string);
}