SA-MP Forums Archive
/stuck command bug - 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: /stuck command bug (/showthread.php?tid=443366)



/stuck command bug - mouadys - 11.06.2013

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);
        }



Re: /stuck command bug - RALL0 - 11.06.2013

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);
        }



Re: /stuck command bug - mouadys - 11.06.2013

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


Re: /stuck command bug - RALL0 - 11.06.2013

Код:
     
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;
            }
}



Re: /stuck command bug - mouadys - 11.06.2013

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 :/


Re: /stuck command bug - mouadys - 11.06.2013

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


Re: /stuck command bug - RALL0 - 11.06.2013

You're welcome