27.10.2011, 14:05
I need help, im making a /gbob (getbackonbike) // (Enables the Alt key being pressed to get back on bike) command where if you fall off and press a key it will get you back on it... kind of like anti fall but not automatic
Top of script
OnPlayerCommandText
OnPlayerExitVehicle
OnPlayerStateChange
im kinda stuck from here... I got 23 errors using that and cannot work out how to bind it to a key ( KEY_WALK) // lalt
Top of script
Код:
new PInCar [MAX_PLAYERS]; new WhatCar[MAX_PLAYERS]; // GetPlayerVehicleID
Код:
if(strcmp(cmdtext,"/gbob",true)== 0) {
if (PInCar[playerid] == 1)
{
SendClientMessage(playerid,COLOR_RED,"You can now get back on your bike by pressing ALT.");
}
return 1;
}
Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
PInCar[playerid] = 0;
return 1;
}
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_DRIVER)
{
if(newstate == PLAYER_STATE_ONFOOT)
{
if(PInCar[playerid] == 1)
{
PutPlayerInVehicle(playerid, WhatCar[playerid], Driver); // WhatCar = GetPlayerVehicleID
return 1;
}


