fixed -
Kar - 23.06.2010
anyideas?
Re: fix and flip command not working ingame -
CAR - 23.06.2010
change user to playerid...
Re: fix and flip command not working ingame -
Kar - 23.06.2010
no change. btw if you didnt notice im using zcmd
Re: fix and flip command not working ingame -
Anthony_Brassi - 23.06.2010
Код:
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;
}
Re: fix and flip command not working ingame -
Kar - 23.06.2010
fix?
Re: fix and flip command not working ingame -
CAR - 23.06.2010
Lol, isn't that just what I said...
Change user to playerid!!
Re: fix and flip command not working ingame -
dice7 - 23.06.2010
You don't need sscanf in either of those functions
Re: fix and flip command not working ingame -
DJDhan - 23.06.2010
Код:
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;
}
Re: fix and flip command not working ingame -
Kar - 23.06.2010
ah finally. ty. DJDhan is so pro;p
Re: fixed -
MastahServers - 23.06.2010
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;
}