/vslap not working -
nogh445 - 27.08.2012
This is the code and It will not move the car into the air. Should I not use GetVehiclePos and SetVehiclePos?
pawn Код:
CMD:vslap(playerid, params[])
{
new targetid, Float:x, Float:y, height, Float:z, string[128];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "Only Administrators have access to this command");
if(sscanf(params, "ui",targetid, height)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /vslap [id] [height]");
if(targetid != INVALID_PLAYER_ID)
{
GetVehiclePos(targetid, x, y, z);
SetVehiclePos(targetid, x, y, z+ height);
format(string, sizeof(string),"Administrator %s has slapped your vehicle %d feet high",pName(playerid), height);
SendClientMessage(targetid,COLOR_RED,string);
format(string, sizeof(string),"You have slapped %s's vehicle %d feet high",pName(targetid), height);
SendClientMessage(playerid,COLOR_RED,string);
}
return 1;
}
Re: /vslap not working - HuSs3n - 27.08.2012
pawn Код:
CMD:vslap(playerid, params[])
{
new targetid, Float:x, Float:y, Float:height,v, Float:z, string[128];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "Only Administrators have access to this command");
if(sscanf(params, "uf",targetid, height)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /vslap [id] [height]");
if(!IsPlayerInAnyVehicle(targetid)) return SendClientMessage(playerid, COLOR_RED, " ERROR: This player is not in a vehicle");
new v=GetPlayerVehicleID(targetid);
GetVehiclePos(v, x, y, z);
SetVehiclePos(v, x, y, z+ height);
format(string, sizeof(string),"Administrator %s has slapped your vehicle %d feet high",pName(playerid), height);
SendClientMessage(targetid,COLOR_RED,string);
format(string, sizeof(string),"You have slapped %s's vehicle %d feet high",pName(targetid), height);
SendClientMessage(playerid,COLOR_RED,string);
return 1;
}
Re: /vslap not working -
CoDeZ - 27.08.2012
pawn Код:
CMD:vslap(playerid, params[])
{
new targetid, Float:x, Float:y, height, Float:z, string[128];
if(sscanf(params, "ui",targetid, height)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /vslap [id] [height]");
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "Only Administrators have access to this command");
if(!IsPlayerConnected(targetit)) return SendClientMessage(playerid,COLOR_RED,"This player is not connected");
if(!IsPlayerInAnyVehicle(targetid)) return SendClientMessage(playerid,COLOR_RED,"This player is not at any vehicle");
new vehicleid=GetPlayerVehicleID(targetid);
GetVehiclePos(targetid, x, y, z);
SetVehiclePos(targetid, x, y, z+ height);
format(string, sizeof(string),"Administrator %s has slapped your vehicle %d feet high",pName(playerid), height);
SendClientMessage(targetid,COLOR_RED,string);
format(string, sizeof(string),"You have slapped %s's vehicle %d feet high",pName(targetid), height);
SendClientMessage(playerid,COLOR_RED,string);
return 1;
}
SetVehiclePosition and getVehiclePosition uses the vehicleid parameter not the the targetid bro
fuuu i was late