CMD:pm(playerid, params[])
{
new id, msg[100];
if(sscanf(params, "is", id, msg))
return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /Pm <playerid> <message>");
if(!IsPlayerConnected(id))
return SendClientMessage(playerid, 0xFF0000FF, "ERROR: This player is not connected!");
if(id == playerid)
return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot use this on yourself!");
new name[MAX_PLAYER_NAME+1], string[128];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "PM from %s (ID: %i): %s", name, playerid, msg);
SendClientMessage(id, 0x00FF00FF, string);
GetPlayerName(id, name, sizeof(name));
format(string, sizeof(string), "PM to %s (ID: %i): %s", name, id, msg);
SendClientMessage(playerid, 0x00FF00FF, string);
return 1;
}
#include <sscanf>
#include <zcmd>
C:\Users\aman\Desktop\Land of Paradise 0.3x\gamemodes\gamemodes\BTRTDM.pwn(51849) : warning 219: local variable "name" shadows a variable at a preceding level C:\Users\aman\Desktop\Land of Paradise 0.3x\gamemodes\gamemodes\BTRTDM.pwn(51850) : error 035: argument type mismatch (argument 2) C:\Users\aman\Desktop\Land of Paradise 0.3x\gamemodes\gamemodes\BTRTDM.pwn(51850) : error 035: argument type mismatch (argument 2) C:\Users\aman\Desktop\Land of Paradise 0.3x\gamemodes\gamemodes\BTRTDM.pwn(51854) : error 035: argument type mismatch (argument 2) C:\Users\aman\Desktop\Land of Paradise 0.3x\gamemodes\gamemodes\BTRTDM.pwn(51854) : error 035: argument type mismatch (argument 2) C:\Users\aman\Desktop\Land of Paradise 0.3x\gamemodes\gamemodes\BTRTDM.pwn(51849) : warning 204: symbol is assigned a value that is
new name[MAX_PLAYER_NAME+1], string[128];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, name, sizeof(name));
CMD:pm(playerid, params[])
{
new id, msg[100];
if(sscanf(params, "is", id, msg))
return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /Pm <playerid> <message>");
if(!IsPlayerConnected(id))
return SendClientMessage(playerid, 0xFF0000FF, "ERROR: This player is not connected!");
if(id == playerid)
return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot use this on yourself!");
new pname[MAX_PLAYER_NAME+1], string[128];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "PM from %s (ID: %i): %s", pname, playerid, msg);
SendClientMessage(id, 0x00FF00FF, string);
GetPlayerName(id, pname, sizeof(pname));
format(string, sizeof(string), "PM to %s (ID: %i): %s", pname, id, msg);
SendClientMessage(playerid, 0x00FF00FF, string);
return 1;
}
|
pawn Код:
|