Admin system -
VirtasVarsketis - 21.09.2015
Hello, straight to the problem, here's the script:
CMD:givescore(playerid, params[])
{
if (PlayerInfo[playerid][pPriz] >= 1)
{
new string[128], giveplayerid, score;
new VBName[MAX_PLAYER_NAME], VBName1[MAX_PLAYER_NAME];
GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
GetPlayerName(giveplayerid, VBName1, MAX_PLAYER_NAME);
if(sscanf(params, "dd", giveplayerid, score)) return SendClientMessage(playerid, COLOR_PURPLE, "Naudojimas: /givescore [ћaidėjoid] [taљkai]");
if(IsPlayerConnected(giveplayerid))
{
givescore(giveplayerid, score);
format(string, sizeof(string), "Admin'as %s davė %s %d taљkų.", VBName, VBName1, score);
SendStaffMessage(COLOR_DRED, string);
}
}
return 1;
}
Is there a way that not only player who is pPriz could use this command? Like one that is pSav can use it.
Re: Admin system -
jlalt - 21.09.2015
PHP код:
CMD:givescore(playerid, params[])
{
if (PlayerInfo[playerid][pPriz] >= 1 || PlayerInfo[playerid][pSav] >= 1 || PlayerInfo[playerid][pAdmin[example]] >= 1) // and complete like that :)
{
new string[128], giveplayerid, score;
new VBName[MAX_PLAYER_NAME], VBName1[MAX_PLAYER_NAME];
GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
GetPlayerName(giveplayerid, VBName1, MAX_PLAYER_NAME);
if(sscanf(params, "dd", giveplayerid, score)) return SendClientMessage(playerid, COLOR_PURPLE, "Naudojimas: /givescore [žaidėjoid] [taškai]");
if(IsPlayerConnected(giveplayerid))
{
givescore(giveplayerid, score);
format(string, sizeof(string), "Admin'as %s davė %s %d taškų.", VBName, VBName1, score);
SendStaffMessage(COLOR_DRED, string);
}
}
return 1;
}
Re: Admin system -
VirtasVarsketis - 21.09.2015
Thank you again xD y u scripting god
Re: Admin system -
VirtasVarsketis - 21.09.2015
oopsie, didn't saw an error for those losse idenditations, one error:
D:\Documents and Settings\Administrator\Desktop\Sa-Mp Server\Drift Serveris\pawno\Login.pwn(215) : error 029: invalid expression, assumed zero
Line 215:
{
Any suggestions?
Re: Admin system -
VirtasVarsketis - 21.09.2015
nvm, just fixed it xD