SA-MP Forums Archive
Please Help !! - 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: Please Help !! (/showthread.php?tid=275266)



Please Help !! - BigAl - 09.08.2011

Код:
 OnPlayerCommandReceived(playerid, cmdtext[])
{
	CMD:pm(playerid, params[])
	{
	    new str[256], str2[256], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
	    if(sscanf(params, "us", id, str2))
	    {
	        SendClientMessage(playerid, 0xFF0000FF, "Usage: /pm <id> <message>");
	        return 1;
	    }
	    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Player not connected");
	    if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot pm yourself!")
	    {
	        GetPlayerName(playerid, Name1, sizeof(Name1));
	        GetPlayerName(id, Name2, sizeof(Name2));
	        format(str, sizeof(str), "PM To %s(ID %d): %s", Name2, id, str2);
	        SendClientMessage(playerid, 0xFF0000FF, str);
	        format(str, sizeof(str), "PM From %s(ID %d): %s", Name1, playerid, str2);
	        SendClientMessage(id, 0xFF0000FF, str);
	    }
	    return 1;
	}
Код:
 D:\Programs\New folder\GTA San Andreas\Gta servers\Drifting Venom\gamemodes\Drifting_Venoms.pwn(753) : warning 203: symbol is never used: "OnPlayerCommandReceived"
I don't get what to do, what do you suggest I do?


Re : Please Help !! - Soumi - 09.08.2011

You don't really need to use this.. Just remove it and leave the command.

EDIT: you forgot this at the end of
Quote:

SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot pm yourself!")




Re: Please Help !! - BigAl - 09.08.2011

Okay, thanks...I'll try...


Re: Please Help !! - DRIFT_HUNTER - 09.08.2011

OnPlayerCommandReceived is custom callback from ZCMD (maybe YCMD have it to)
So you just need to include your command system .inc file

Ex for ZCMD: #include <zcmd>
(You must have include in your pawn/includes folder)