SA-MP Forums Archive
something wrong at cmd:flip - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: something wrong at cmd:flip (/showthread.php?tid=512159)



something wrong at cmd:flip - KillerStrike23 - 09.05.2014

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 ?


Re: something wrong at cmd:flip - Konstantinos - 09.05.2014

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).


Re: something wrong at cmd:flip - Smileys - 09.05.2014

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.


Re: something wrong at cmd:flip - KillerStrike23 - 09.05.2014

I need codes please guys !


Re: something wrong at cmd:flip - Beckett - 09.05.2014

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.