/giveallscore dcmd for LuxAdmin - 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: /giveallscore dcmd for LuxAdmin (
/showthread.php?tid=390515)
/giveallscore dcmd for LuxAdmin -
MehranGta - 06.11.2012
Hey all i want how to make /giveallscore cmd for luxadmin like this any one can make this for me and got 2 rep tnx
this is orginal lux admin cmd:
Код:
dcmd_giveallcash(playerid,params[])
{
if(AccInfo[playerid][Level] >= 3)
{
if(!strlen(params)) return
SendClientMessage(playerid, LIGHTBLUE2, "Usage: /giveallcash [Value]") &&
SendClientMessage(playerid, orange, "Function: Will give a specified value in Money for all players");
new var = strval(params), string[128];
SendCommandToAdmins(playerid,"GiveAllCash");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
PlayerPlaySound(i,1057,0.0,0.0,0.0);
GivePlayerMoney(i,var);
}
}
format(string,sizeof(string),"|- Administrator \"%s\" has given all Players '$%d' -|", pName(playerid), var );
return SendClientMessageToAll(blue, string);
}
else return ErrorMessages(playerid, 1);
}
i got make this but when i m in game it say unknown cmd:
Код:
dcmd_giveallscore(playerid,params[])
{
if(AccInfo[playerid][Level] >= 3) {
if(!strlen(params)) return
SendClientMessage(playerid, LIGHTBLUE2, "USAGE: /giveallscore [score]");
SendClientMessage(playerid, orange, "Function: Will give a specified value in Score for all players");
new var = strval(params), string[128];
SendCommandToAdmins(playerid,"GIVEALLSCORE");
for(new i = 0; i < MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) {
PlayerPlaySound(i,1057,0.0,0.0,0.0);
SetPlayerScore(playerid, GetPlayerScore(playerid)+var);
}
}
format(string,sizeof(string),"Administrator \"%s\" has given all players '%d' score/s", pName(playerid), var );
return SendClientMessageToAll(blue, string); }
else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");}
Re: /giveallscore dcmd for LuxAdmin -
Abreezy - 06.11.2012
Don't you have to add the dcmd line onplayercommand up top also?
If I was you, I would just use zcmd, foreach, sscanf so for example:
pawn Код:
CMD:giveallscore(playerid, params[])
{
new escore, string[128];
if(AccInfo[playerid][Level] >= 3)
{
if(sscanf(params, "d", escore)) return SendClientMessage(playerid, -1, "USAGE: /giveallscore amount");
foreach(Player, x)
{
format(string, sizeof(string), "You have been given an extra %d score.", escore);
SendClientMessage(x, -1, string);
SetPlayerScore(x, GetPlayerScore(x) + escore);
}
}
else
{
SendClientMessage(playerid, -1, "You aren't high enough level to use this command.");
}
return 1;
}
Best of luck.