SA-MP Forums Archive
lil help with strcmp - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: lil help with strcmp (/showthread.php?tid=246023)



lil help with strcmp - [MWR]Blood - 02.04.2011

Well it sends the message saying that vehicle is owned by...
but it doesnt remove the player from the vehicle, why?
pawn Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new string[128];
    format(string,sizeof(string),"%s",Carowner);
    if(strcmp(GetPName(playerid),Carowner) == -1)
    {
        RemovePlayerFromVehicle(playerid);
        SendFMessage(playerid,red,"[Private Car]"lgreen"That vehicle is owned by "lyellow"%s"lgreen"!",Carowner);
    }
    return 1;
}



Re: lil help with strcmp - ~Yoshi - 02.04.2011

RemovePlayerFromVehicle only works when the vehicle isn't moving.

Use something like this instead:

pawn Code:
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
SetPlayerPos(playerid, X+2, Y, Z);