06.09.2009, 01:30
Eject Code
and the other one i cant help with you with cause i dont know your script
Код:
if(strcmp(cmd, "/eject", true) == 0) { if(IsPlayerConnected(playerid)) { new State; if(IsPlayerInAnyVehicle(playerid)) { State=GetPlayerState(playerid); if(State!=PLAYER_STATE_DRIVER) { SendClientMessage(playerid,COLOR_GREY,"[ERROR:] You can only eject a user as the driver!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[USAGE:] /eject [playerid/PartOfName]"); return 1; } new playa; playa = ReturnUser(tmp); new test; test = GetPlayerVehicleID(playerid); if(IsPlayerConnected(playa)) { if(playa != INVALID_PLAYER_ID) { if(playa == playerid) { SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] You can't eject yourself!"); return 1; } if(IsPlayerInVehicle(playa,test)) { format(string, sizeof(string), "[INFO:] You have thrown out: %s.", GetPlayerNameEx(playa)); SendClientMessage(playerid, COLOR_WHITE, string); format(string, sizeof(string), "[INFO:] You have been thrown out of the car by: %s.", GetPlayerNameEx(playerid)); SendClientMessage(playa, COLOR_WHITE, string); RemovePlayerFromVehicle(playa); } else { SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] That user is not even in your car!"); return 1; } } } else { SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] Invalid ID."); } } else { SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] You are not in a vehicle!"); } } return 1; }