Little help! +Rep - 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: Little help! +Rep (
/showthread.php?tid=373476)
Little help! +Rep -
Nirzor - 30.08.2012
i want to make a command that if player is rcon admin then player enters command /giveteamscore then type the
name of the team like i have FBI and Killer this name i want it to be like when player types /giveteamscore [0] it will
be FBI as fbi is team 0 and team 1 is Killer /giveteamscore [1] so i want want if i use /giveteamscore [teamid] the team
will instantly get 1 score i don't want it that i need to put amount i directly want if i type /giveteamscore [teamid]
automatically 1 score will be given to team thanks!
Re: Little help! +Rep -
Faisal_khan - 30.08.2012
What command processor you use?
Re: Little help! +Rep -
Nirzor - 30.08.2012
ZCMD bro!
Re: Little help! +Rep -
Faisal_khan - 30.08.2012
This is the stock function for it:
pawn Код:
stock GiveTeamScore(teamid, score)
{
for(new i; i < MAX_PLAYERS; i++)
{
if(Team[i] = teamid)
{
SetPlayerScore(i, GetPlayerScore(i) + score);
}
}
}
Just make a command and add GiveTeamScore(teamid, score).
Re: Little help! +Rep -
Nirzor - 30.08.2012
does'nt work with the CMD can u show me with cmd CMD:GiveTeamScore plz!
Re: Little help! +Rep -
Faisal_khan - 30.08.2012
YCMD:
pawn Код:
CMD:giveteamscore(playerid,params[])
{
if(PlayerAcc[playerid][AdminLevel] >= 5)//here your admin level
{
new teamid, score;
if(!sscanf(params, "ui", teamid,score))
{
GiveTeamScore(teamid, score);
new pstring[400];
format(pstring,sizeof(pstring),"Admin %s has given team %s %d score",playerid,teamid,score);
SendClientMessage(teamid,COLOR_YELLOW,pstring);
}
}
return 1;
}