[Help] Problem with slap command - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] Problem with slap command (
/showthread.php?tid=72388)
[Help] Problem with slap command -
YegerMaster - 08.04.2009
Sorry for double...
Re: [Help] Problem with slap command -
YegerMaster - 08.04.2009
Hi all people,
I new in the forum and in PWN language...

And i have some problem in the slap command.
The command work fine,
But if i slap someone i dont see this:"AdmCmd: %s slapped %s" and "AdmCmd: %s was slapped by %s"
I use Carlitos Roleplay GM.
Please if someone can help me for this problem...
Thank's you very much!
Код:
if(strcmp(cmd, "/slap", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /slap [playerid/PartOfName]");
return 1;
}
new playa;
new Float:shealth;
new Float:slx, Float:sly, Float:slz;
playa = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >=1)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerHealth(playa, shealth);
SetPlayerHealth(playa, shealth-5);
GetPlayerPos(playa, slx, sly, slz);
SetPlayerPos(playa, slx, sly, slz+5);
PlayerPlaySound(playa, 1130, slx, sly, slz+5);
printf("AdmCmd: %s slapped %s",sendername, giveplayer);
format(string, sizeof(string), "AdmCmd: %s was slapped by %s",giveplayer ,sendername);
AdministratorMessage(COLOR_ADMINCMD,string,1);
}
}
}
else
{
SendClientMessage(playerid, COLOR_ADMINCMD, " you are not authorized to use that command!");
}
}
return 1;
}
Re: [Help] Problem with slap command -
SpiderPork - 08.04.2009
Show us your "AdministratorMessage" thingy.
Re: [Help] Problem with slap command -
YegerMaster - 08.04.2009
This
Код:
forward AdministratorMessage(color,const string[],level);
Or this
Код:
public AdministratorMessage(color,const string[],level)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if (PlayerInfo[i][pAdmin] >= level)
{
if(AdminDuty[i] == 1)
{
SendClientMessage(i, color, string);
}
}
}
}
return 1;
}
I need set the color?
where?
Re: [Help] Problem with slap command -
Jochemd - 30.04.2010
Well, you see the SendClientMessage. There's a color tag in it