28.03.2011, 08:25
ok but
when i type /slap it slaps my self and don't say you have been slaped by vip(name) can someone fix it and make it like in Lux Admin or Ladmin but it will be for Vip
pawn Код:
CMD:vslap(playerid,params[])
{
if(GetPVarInt(playerid, "vip") < 2) return SendClientMessage(playerid, 0xFF0000FF, "Your not a Diamond vip(Level 3).");
new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /slap [playerid] [reason/with]");
new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
player1 = strval(tmp);
GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname));
new Float:Health, Float:x, Float:y, Float:z; GetPlayerHealth(player1,Health); SetPlayerHealth(player1,Health-25);
GetPlayerPos(player1,x,y,z); SetPlayerPos(player1,x,y,z+5); PlayerPlaySound(playerid,1190,0.0,0.0,0.0); PlayerPlaySound(player1,1190,0.0,0.0,0.0);
if(strlen(tmp2)) {
format(string,sizeof(string),"You have been slapped by Vip%s %s ",adminname,params[2]); SendClientMessage(player1,red,string);
format(string,sizeof(string),"You have slapped %s %s ",playername,params[2]); return SendClientMessage(playerid,blue,string);
} else {
format(string,sizeof(string),"You have been slapped by Vip %s ",adminname); SendClientMessage(player1,red,string);
format(string,sizeof(string),"You have slapped %s",playername); return SendClientMessage(playerid,blue,string);}
}