02.11.2009, 16:43
Hey please help me please give me commands /givescore
- RenisiL
- RenisiL
Originally Posted by RenisiL
Hey please help me please give me commands /givescore
|
//needs dcmd and sccanf - search or pm me if you dont have it.
//top - global var
new String[128];
//OnPlayerCommandText
dcmd(givescore, 9, cmdtext);
//Anywhere else (not in a callback ofc)
dcmd_givescore(playerid, params[])
{
new GivePlayerID, Score;
if(!sscanf(params, "ud", GivePlayerID, Score))
{
if(IsPlayerConnected(GivePlayerID))
{
new Name[MAX_PLAYER_NAME], pName[MAX_PLAYER_NAME],current = GetPlayerScore(GivePlayerID);
SetPlayerScore(GivePlayerID, current+Score);
GetPlayerName(GivePlayerID, Name, sizeof(Name));
GetPlayerName(playerid, pName, sizeof(pName));
format(String, sizeof(String), "You were given %d score points by %s!",Score,pName);
SendClientMessage(playerid, 0xFFFFFFFF, String);
format(String, sizeof(String), "You gave %s %d score points!",Name,Score);
SendClientMessage(playerid, 0xFFFFFFFF, String);
return 1;
}
SendClientMessage(playerid,0xAA3333AA, "Error: That player isnt connected!");
return 1;
}
SendClientMessage(playerid,0xAA3333AA, "Syntax Error: /Givescore <UserName/ID> <Score>");
return 1;
}
pawn Код:
|