SA-MP Forums Archive
Why this wont work :( - 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: Why this wont work :( (/showthread.php?tid=319324)



Why this wont work :( - Gooday - 18.02.2012

pawn Код:
CMD:seat3(playerid, params[])
{
    new vehicleid;
    new id;
    new giveplayerid;
    if(GetPlayerSkin(playerid) == 285 || GetPlayerSkin(playerid) == 282 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 283 || GetPlayerSkin(playerid) == 288)
    if (sscanf(params, "u", id)) SendClientMessage(playerid, COLOR_LIGHTBLUE, "Usage: /Seat3 [ID]");
    else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "[INFO]Player not found");
    else
    {
     SendClientMessage(playerid, COLOR_GOLD, "[INFO]Player Loaded succesfully");
     PutPlayerInVehicle(id,vehicleid,3);
     TogglePlayerControllable(id, 0);
     SendClientMessage(id, COLOR_GOLD,"[INFO]You have been loaded in a Police Vehicle by a APSO Officer");
     SetPlayerColor(id,COLOR_LIGHTBLUE);
     ResetPlayerWeapons(id);
    }
    return 1;
}
This should load the ID of the player in the car of the playerid, but the ID just got freezed


Re: Why this wont work :( - iZN - 18.02.2012

Remove TogglePlayerControllable(id, 0); line.


Re: Why this wont work :( - Gooday - 18.02.2012

But it wont load anyway :/ I think and i need to freeze the player in the car


Re: Why this wont work :( - iZN - 18.02.2012

Then you have to add timer to your script.


Re: Why this wont work :( - Gooday - 18.02.2012

The main problem is that the player wont be teleported in the car