seats ids?
#1

im a bit confused here i need it like if another player is already in that seat id to put the player to another seat and if there seat id is not available put it in seat id 2 if that seat is free
(wiki said its surpose to be in the loop but idk)
pawn Код:
CMD:drag(playerid,params[])
{
    new id,Float:x, Float:y, Float:z,idname[MAX_PLAYER_NAME],name[MAX_PLAYER_NAME];
    if(sscanf(params, "u", id)) return SendClientMessage(playerid, 0xFF00AAFF, "*USAGE: /drag [playerid / part of name]");
    if(gTeam[playerid] != TEAM_COPS) return SendClientMessage(playerid, 0xFF00AAFF, "*ERROR: You are not a Police Officer!");
    if (GetPlayerWantedLevel(id) <= 3) return SendClientMessage(playerid, 0xFF0000AA, "Error: This Player Does Not Have A Warrant Please Use /ar [playerid]");
    if(id == playerid) return SendClientMessage(playerid, 0xFF00AAFF, "*ERROR: You Cannot Drag Yourself.");
    if (!IsPlayerConnected(id)) SendClientMessage(playerid, RED, "Invalid id");
    if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF00AAFF, "*ERROR: You Cannot Drag Yourself.");
    if(IsPlayerInRangeOfPoint(id, 10, x, y, z)) return SendClientMessage(playerid, COLOR_GREY, "Player is not close enough!");
    if(PlayerInfo[playerid][LastVeh] == 0) return SendClientMessage(playerid,red,"Go get a seat in some near car before doing that!");
    {
        PutPlayerInVehicle(playerid,PlayerInfo[playerid][LastVeh],1);
        PutPlayerInVehicle(id,PlayerInfo[playerid][LastVeh],3);
        new string[128];
        format(string, 128, "You Have Dragged %s(%d) Into Your Vehicle", idname, id);
        SendClientMessage(playerid, orange, string);
        format(string, 128, "Officer %s(%d) Has Dragged You Into His Vehicle!", name, playerid);
        SendClientMessage(id, orange, string);
        for(new i = 0; i<MAX_PLAYERS; i++)
        {
        GetPlayerVehicleSeat(i);
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)