25.05.2010, 14:07
I am admin level 3 and telling me i am not allowed to use that command.. :S
-------------------------
Here it doesn't send the message to all players.. :S
pawn Код:
dcmd_slap(playerid, params[])
{
new slapid;
new string[128];
new reason[128];
if(UserUD[playerid][admin] < 1 || UserUD[playerid][vip] < 1) return SendClientMessage(playerid,green,"Error: You are not authorized to use this command.");
if(sscanf(params, "uz", slapid, reason)) return SendClientMessage(playerid,green,"Error: /slap ID/Name Reason");
if(!IsPlayerConnected(slapid) || slapid == INVALID_PLAYER_ID || slapid == playerid)return SendClientMessage(playerid,green,"Error: Player is not connected or it is yourself");
format(string,sizeof(string),"Error: %s(id: %d) has slapped %s(id: %d) Reason: %s",UserUD[playerid][accname],playerid,UserUD[slapid][accname],slapid,reason);
SendClientMessageToAll(green,string);
new Float:x,
Float:y,
Float:z;
GetPlayerPos(slapid, x,y,z);
SetPlayerPos(slapid, x, y, z+8);
PlayerPlaySound(slapid, 1190, 0,0,0);
return 1;
}
Here it doesn't send the message to all players.. :S
pawn Код:
new string[128];
new IP[16];
for(new i=0; i<MAX_PLAYERS; i++)
if(UserUD[i][admin] < 1)
{
GetPlayerName(playerid,UserUD[playerid][accname],128);
format(string, sizeof(string), "[JOIN] %s IP: %d", UserUD[playerid][accname],IP);
SendClientMessage(i,red, string);
}
else if(UserUD[i][admin] == 0)
{
GetPlayerName(playerid,UserUD[playerid][accname],128);
format(string, sizeof(string), "[JOIN] %s", UserUD[playerid][accname]);
SendClientMessage(i,red, string);
}