#1



anyideas?
Reply
#2

change user to playerid...
Reply
#3

no change. btw if you didnt notice im using zcmd
Reply
#4

Код:
cmd(flip, playerid, params[])
{
	if(!sscanf(params, "u", playerid))
	{
	 		if(File[playerid][Admin] >= 1)
 			{
 				new VehicleID;
				GetPlayerPos(playerid, X, Y, Z);
				VehicleID = GetPlayerVehicleID(playerid);
				GetVehicleZAngle(VehicleID, Angle);
				SetVehiclePos(VehicleID, X, Y, Z);
				SetVehicleZAngle(VehicleID, Angle);
				GameTextForPlayer(playerid,"~b~FLIPPED!",4000,3);
				SendClientMessage(playerid, BLUE, "FLIPPED!");
				}
		}
	return 1;
}
Reply
#5

fix?
Reply
#6

Lol, isn't that just what I said...

Change user to playerid!!
Reply
#7

You don't need sscanf in either of those functions
Reply
#8

Код:
CMD:fix(playerid, params[])
{	
	if(File[playerid][Admin] > 0)
	{
		new vehicleid;
		vehicleid = GetPlayerVehicleID(user);
		RepairVehicle(vehicleid);
	}
	return 1;
}



CMD:flip(playerid, params[])
{
	if(File[playerid][Admin] >= 1)
 	{
 		new VehicleID,Angle;
		VehicleID = GetPlayerVehicleID(user);
		new Float:x, Float:y, Float:z;
		
		GetVehicleZAngle(VehicleID, Angle);
		SetVehiclePos(VehicleID, X, Y, Z);
		SetVehicleZAngle(VehicleID, Angle);
		
		
		GameTextForPlayer(playerid,"~b~FLIPPED!",4000,3);
	}
	return 1;
}
Reply
#9

ah finally. ty. DJDhan is so pro;p
Reply
#10

No offence, but if you don't know /flip, or /fix, then I'd rather you to get a /fix and /flip with strcmp, which I got for you.
Its easy to understand for beginners, only its a bit bigger.


The /fix (/repair) command - both types of command will work in the same strcmp
pawn Код:
if(!strcmp(cmd, "/repair", true, 7) || strcmp(cmd, "/fix", true, 4) == 0)
        {
        new Float:vehhealth;
        new veh;
        veh = GetPlayerVehicleID(playerid);
        GetVehicleHealth(veh, vehhealth);
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED,"ERROR: not in a vehicle!");
        if (playerState == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, COLOR_RED,"ERROR: be the driver to repair the vehicle");
            SetVehicleHealth(veh,1000);
            RepairVehicle(veh);
            SendClientMessage(playerid, COLOR_GREEN,"You have repaired your vehicle");
            return 1;
        }
The /flip command
pawn Код:
if(strcmp("/flip", cmdtext, true) == 0)
        {
            if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_RED,"ERROR: not in a vehicle!");
            if (playerState == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, COLOR_RED,"ERROR: be the driver to flip the vehicle");
        new vehicle;
        new Float:angle;
        vehicle  = GetPlayerVehicleID(playerid);
        GetVehicleZAngle(vehicle, angle);
        SetVehicleZAngle(vehicle, angle);
            SendClientMessage(playerid, COLOR_GREEN, "You have flipped your vehicle");
            return 1;
        }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)