/setscore - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /setscore (
/showthread.php?tid=221957)
/setscore -
Jack_Rocker - 06.02.2011
How can I make a setscore command? I have the base kinda thing:
pawn Code:
if (strcmp("/setscore", cmdtext, true, 10) == 0)
{
if(pInfo[playerid][AdminLevel] < 4)
{
}
else
{
SendClientMessage(playerid, COLOR_RED, "Admin Level 4 Only!")
}
return 1;
}
Thanks for your help!
Re: /setscore -
xRyder - 06.02.2011
Use ZCMD instead of strcmp thing.
Re: /setscore -
admantis - 06.02.2011
Easy with sscanf and zcmd
pawn Code:
CMD:score(playerid, params[])
{
new id, score, str[84], victimname[28], adminname[28];
if (pInfo[playerid][pAdminLevel] >= 4)
{
if (sscanf(params, "ui", id, score)) return SendClientMessage(playerid, COLOR_LIGHTRED, "USAGE: /score [id] [ammount]");
if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GRAY, "AdmCmd: This player is not connected.");
SetPlayerScore(id, score);
GetPlayerName(id, victimname, 28);
GetPlayerName(playerid, adminname, 28);
format(str, 84, "AdmWarn: You've given %s [ID %d] score %d", victimname, id, score);
SendClientMessage(COLOR_LIGHTBLUE,str);
format(str,84,"You've received %d score from admin %s [ID %d]", score, adminname, playerid);
SendClientMessage(id, COLOR_LIGHTBLUE, str);
return 1;
}
else return SendClientMessage(playerid,COLOR_GRAY," You don't have authorization!");
}
Re: /setscore -
Jack_Rocker - 06.02.2011
I need it in strcmp
Re: /setscore -
xRyder - 06.02.2011
Why not using ZCMD and sscanf??
It's a lot easier. You can see it from command what admantis made.
Re: /setscore -
admantis - 06.02.2011
Quote:
Originally Posted by xRyder
Why not using ZCMD and sscanf??
|
He is just probably lazy to convert his commands, but I had +150 and it only took me 2 hours.
I had a /setscore command in strcmp, but I deleted it, sorry bud.
Re: /setscore -
Jack_Rocker - 06.02.2011
Quote:
Originally Posted by admantis
He is just probably lazy to convert his commands, but I had +150 and it only took me 2 hours.
I had a /setscore command in strcmp, but I deleted it, sorry bud.
|
I will covert everthing into zcmd I think it looks better anyway! thanks for helping
Re: /setscore -
admantis - 06.02.2011
Indeed. If you need help , ask. I thought it was hard as well but now I notice its x10 easier than strcmp.