Admin system
#1

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.
Reply
#2

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;

Reply
#3

Thank you again xD y u scripting god
Reply
#4

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?
Reply
#5

nvm, just fixed it xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)