02.01.2015, 05:13
PHP Code:
CMD:pinc(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
new id, seatid, AdminName[MAX_PLAYER_NAME], string[128], tt[MAX_PLAYER_NAME], strr[128];
GetPlayerName(playerid, AdminName, sizeof(AdminName));
if(sscanf(params, "ud", id, seatid)) return SendClientMessage(playerid, WHITE, "USAGE:/pinc [partofname/playerid] [seatID]");
if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, RED, "Player not found!");
if(!IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, RED, "You have to be in a car to use this command!");
if(seatid >= 4 || seatid < 1) return SendClientMessage(playerid, RED, "Invalid SeatID!");
new Float:pincX, Float:pincY, Float:pincZ, curtveh, vehseat;
curtveh = GetPlayerVehicleID(playerid);
vehseat = GetPlayerVehicleSeat(id);
if(IsSeatTaken(curtveh, seatid)==1) reutn SendClientMessage(playerid, RED, "This seat is already taken.");
GetVehiclePos(curtveh, pincX, pincY, pincZ);
PutPlayerInVehicle(id,curtveh,seatid);
}
else SendClientMessage(playerid, RED, "You are not a admin!");
return 1;
}