15.03.2013, 17:37
pawn Код:
CMD:transfer(playerid, params[])
{
new Target[MAX_PLAYER_NAME], amount, name[MAX_PLAYER_NAME], bool:found;
if(sscanf(params, "s[MAX_PLAYER_NAME]d", Target, amount))
return SendClientMessage(playerid, -1, "USAGE: /transfer [Exact_Name] [amount]");
for( new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GetPlayerName(i, name, sizeof(name));
if(strcmp(Target, name) == 0)
{
found = true;
// You command here..
}
}
}
if(found == false) return SendClientMessage(playerid, -1, "ERROR: Use the exact player name!");
return 1;
}
NOTE: You need ZCMD and sscanf