CMD:slapcar(playerid,params[]) {
new otherplayer, othercar;
if(sscanf(params,"u",otherplayer)) return SendClientMessage(playerid,COLOR_RED,"Usage: /slapcar [playerid]");
if(!IsPlayerInAnyVehicle(otherplayer)) return SendClientMessage(playerid,COLOR_RED,"That player is not inside any vehicles");
new Float:x,Float:y,Float:z;
othercar = GetPlayerVehicleID(otherplayer);
GetVehiclePos(othercar,x,y,z);
SetVehiclePos(othercar,x,y,z+10); //slap their vehicle
new string[128];
format(string,sizeof(string),"You slapped vehicle ID: %i",othercar);
SendClientMessage(playerid,COLOR_RED,string);
return true;
}
CMD:slapcar(playerid,params[]) {
new otherplayer, othercar;
if(sscanf(params,"u",otherplayer)) return SendClientMessage(playerid,COLOR_RED,"Usage: /slapcar [playerid]");
if(!IsPlayerInAnyVehicle(otherplayer)) return SendClientMessage(playerid,COLOR_RED,"That player is not inside any vehicles");
new Float:x,Float:y,Float:z;
othercar = GetPlayerVehicleID(otherplayer);
GetVehiclePos(othercar,x,y,z);
SetVehiclePos(othercar,x,y,z+10); //slap their vehicle
new string[128];
format(string,sizeof(string),"You slapped vehicle ID: %i",othercar);
SendClientMessage(playerid,COLOR_RED,string);
GetPlayerPos(otherplayer,x,y,z);
SetPlayerPos(otherplayer,x,y,z+10);
return true;
}
Thanks, but you can put restricted for players, and just admins to use it admin level 1+.
|
CMD:slapcar(playerid,params[]) {
new otherplayer, othercar;
if(playerVariables[playerid][pAdminLevel] == 0 ) return SendClientMessage(playerid,COLOR_RED,"You are not an admin"); //if they arent admin
if(sscanf(params,"u",otherplayer)) return SendClientMessage(playerid,COLOR_RED,"Usage: /slapcar [playerid]");
if(!IsPlayerInAnyVehicle(otherplayer)) return SendClientMessage(playerid,COLOR_RED,"That player is not inside any vehicles");
new Float:x,Float:y,Float:z;
othercar = GetPlayerVehicleID(otherplayer);
GetVehiclePos(othercar,x,y,z);
SetVehiclePos(othercar,x,y,z+10); //slap their vehicle
new string[128];
format(string,sizeof(string),"You slapped vehicle ID: %i",othercar);
SendClientMessage(playerid,COLOR_RED,string);
return true;
}
CMD:slapcar(playerid,params[]) {
new otherplayer, othercar;
if(playerVariables[playerid][pAdminLevel] == 0 ) return SendClientMessage(playerid,COLOR_RED,"You are not an admin"); //if they arent admin
if(sscanf(params,"u",otherplayer)) return SendClientMessage(playerid,COLOR_RED,"Usage: /slapcar [playerid]");
if(!IsPlayerInAnyVehicle(otherplayer)) return SendClientMessage(playerid,COLOR_RED,"That player is not inside any vehicles");
new Float:x,Float:y,Float:z;
othercar = GetPlayerVehicleID(otherplayer);
GetVehiclePos(othercar,x,y,z);
SetVehiclePos(othercar,x,y,z+10); //slap their vehicle
new string[128];
format(string,sizeof(string),"You slapped vehicle ID: %i",othercar);
SendClientMessage(playerid,COLOR_RED,string);
GetPlayerPos(otherplayer,x,y,z);
SetPlayerPos(otherplayer,x,y,z+10);
return true;
}