something wrong at cmd:flip
#1

pawn Код:
CMD:flip(playerid,params[]) {
    if(PlayerInfo[playerid][Level] >= 3 || IsPlayerAdmin(playerid)) {
        if(isnull(params)) {
            if(IsPlayerInAnyVehicle(playerid)) {
            new VehicleID, Float:X, Float:Y, Float:Z, Float:Angle; GetPlayerPos(playerid, X, Y, Z); VehicleID = GetPlayerVehicleID(playerid);
            GetVehicleZAngle(VehicleID, Angle); SetVehiclePos(VehicleID, X, Y, Z); SetVehicleZAngle(VehicleID, Angle); SetVehicleHealth(VehicleID,1000.0);
            CMDMessageToAdmins(playerid,"FLIP"); return SendClientMessage(playerid, blue,"Vehicle Flipped. You can also do /flip [playerid]");
            } else return SendClientMessage(playerid,red,"Error: You are not in a vehicle. You can also do /flip [playerid]");}
            new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
            player1 = strval(params);
            if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid) {
            CMDMessageToAdmins(playerid,"FLIP");
            if (IsPlayerInAnyVehicle(player1)) {
                new VehicleID, Float:X, Float:Y, Float:Z, Float:Angle; GetPlayerPos(player1, X, Y, Z); VehicleID = GetPlayerVehicleID(player1);
                GetVehicleZAngle(VehicleID, Angle); SetVehiclePos(VehicleID, X, Y, Z); SetVehicleZAngle(VehicleID, Angle); SetVehicleHealth(VehicleID,1000.0);
                RepairVehicle(VehicleID);
                GetPlayerName(player1, playername, sizeof(playername));     GetPlayerName(playerid, adminname, sizeof(adminname));
                format(string,sizeof(string),"You have flipped %s's vehicle", playername);
                return SendClientMessage(playerid, blue,string);
            } else return SendClientMessage(playerid,red,"Error: This player isn't in a vehicle");
        } else return SendClientMessage(playerid, red, "Player is not connected or is yourself");
    } else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");}
here is my flip command there something wrong because everyone can use it if he weren't an admin why ?
Reply
#2

The only thing I could think of is that you don't reset the variables on connect and players get the admin level of the previous player (with that slot).
Reply
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
The only thing I could think of is that you don't reset the variables on connect and players get the admin level of the previous player (with that slot).
yea this.

can you show us your OnPlayerDisconnect and OnPlayerConnect please.
Reply
#4

I need codes please guys !
Reply
#5

Quote:
Originally Posted by KillerStrike23
Посмотреть сообщение
I need codes please guys !
We need codes, not you need codes, we have no codes, you have the code not us.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)