29.04.2012, 08:42
try this:
Код:
dcmd_givescore(playerid, params[]) { new giveplayerid, amount, gscore = GetPlayerScore(playerid); if(sscanf(params, "ud", giveplayerid, amount)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /givescore [playerid/partname] [amount]"); else if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: Player not found"); else if(amount > gscore) return SendClientMessage(playerid, 0xFF0000AA, "ERROE:Unknown Score"); else { SetPlayerScore(giveplayerid,GetPlayerScore(giveplayerid) + amount); SetPlayerScore(playerid,gscore - amount); SendClientMessage(playerid, 0x00FF00AA, "Score Sent"); SendClientMessage(giveplayerid, 0x00FF00AA, "You Recieved Score"); } return 1; }