/stuck command bug
#1

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 :
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);
        }
Reply
#2

Try this

Код:
if(strcmp(cmd, "/stuck", true) == 0) // By CuervO_NegrO
    {
        if(IsPlayerConnected(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(vehicleid))
            {
                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);
        }
Reply
#3

Quote:
Originally Posted by RALL0
Посмотреть сообщение
Try this

Код:
if(strcmp(cmd, "/stuck", true) == 0) // By CuervO_NegrO
    {
        if(IsPlayerConnected(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(vehicleid))
            {
                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);
        }
Not Working .
Still shows me You are in a rental vehicle while im on foot
Reply
#4

Код:
     
new playerstate = GetPlayerState(playerid)       
if(playerstate == PLAYER_STATE_DRIVER)
{
            if(IsASalesVehicle(vehicleid))
            {
                SendClientMessage(playerid, COLOR_GREY, "You are in a sale vehicle. do /exit or use /atalk!");
                return 1;
            }
            if(IsARentableVeh(vehicleid))
            {
                SendClientMessage(playerid, COLOR_GREY, "You are in a rental vehicle. do /exit or use /atalk!");
                return 1;
            }
}
Reply
#5

Quote:
Originally Posted by RALL0
Посмотреть сообщение
Код:
     
new playerstate = GetPlayerState(playerid)       
if(playerstate == PLAYER_STATE_DRIVER)
{
            if(IsASalesVehicle(vehicleid))
            {
                SendClientMessage(playerid, COLOR_GREY, "You are in a sale vehicle. do /exit or use /atalk!");
                return 1;
            }
            if(IsARentableVeh(vehicleid))
            {
                SendClientMessage(playerid, COLOR_GREY, "You are in a rental vehicle. do /exit or use /atalk!");
                return 1;
            }
}
Still not working :/
Reply
#6

Quote:
Originally Posted by RALL0
Посмотреть сообщение
Код:
     
new playerstate = GetPlayerState(playerid)       
if(playerstate == PLAYER_STATE_DRIVER)
{
            if(IsASalesVehicle(vehicleid))
            {
                SendClientMessage(playerid, COLOR_GREY, "You are in a sale vehicle. do /exit or use /atalk!");
                return 1;
            }
            if(IsARentableVeh(vehicleid))
            {
                SendClientMessage(playerid, COLOR_GREY, "You are in a rental vehicle. do /exit or use /atalk!");
                return 1;
            }
}
Oh works thanks
Reply
#7

You're welcome
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)