SA-MP Forums Archive
Admin system - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Admin system (/showthread.php?tid=589674)



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(playeridparams[])
{

if (
PlayerInfo[playerid][pPriz] >= || PlayerInfo[playerid][pSav] >= || PlayerInfo[playerid][pAdmin[example]] >= 1// and complete like that :)
{
new 
string[128], giveplayeridscore;
new 
VBName[MAX_PLAYER_NAME], VBName1[MAX_PLAYER_NAME];
GetPlayerName(playeridVBNameMAX_PLAYER_NAME);
GetPlayerName(giveplayeridVBName1MAX_PLAYER_NAME);
if(
sscanf(params"dd"giveplayeridscore)) return SendClientMessage(playeridCOLOR_PURPLE"Naudojimas: /givescore [žaidėjoid] [taškai]");

if(
IsPlayerConnected(giveplayerid))
{
givescore(giveplayeridscore);
format(stringsizeof(string), "Admin'as %s davė %s %d taškų."VBNameVBName1score);
SendStaffMessage(COLOR_DREDstring);
}
}
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