Ned help with multiple things. - 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: Ned help with multiple things. (
/showthread.php?tid=544146)
Ned help with multiple things. -
mkmk - 31.10.2014
How would I make it so when you talk down the radio and say "Permission to enter the garage, over." You'd be telepored inside the garage? I tried using SetPlayerPos etc but I honestly couldn't figure it out.
One last thing lol, how would I make a /setrank command for FACTION LEADERS.
pawn Код:
Player[playerid][IsLeader] == 1)
Re: Ned help with multiple things. -
JasperM - 31.10.2014
Are you using a script FULLY scripted from scratch? If not, please tell us which script you're using.
Re: Ned help with multiple things. -
DanishHaq - 31.10.2014
For the first query, use strfind to see if those words are said on the radio.
For the second, which command processor are you using? If you are using sscanf and ZCMD it's fairly simple.
Re: Ned help with multiple things. -
mkmk - 31.10.2014
Quote:
Originally Posted by DanishHaq
For the first query, use strfind to see if those words are said on the radio.
For the second, which command processor are you using? If you are using sscanf and ZCMD it's fairly simple.
|
I'm using zcmd for the whole script.
Also, I have some filterscripts if you count that as "FULLY from scratch".
Re : Ned help with multiple things. -
ououdu94 - 31.10.2014
Код:
if(strcmp(cmd, "/setrank", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "[Command] /setrank [playerid/PartOfName] [Number(1-6)]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if(level > 6 || level < 0) { SendClientMessage(playerid, COLOR_GREY, "Rank Min = 0 & Rank Max = 6"); return 1; }
if (Player[playerid][IsLeader] == 1 && Player[playerid][Faction] == Player[para1][Faction])
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
Player[para1][Rank] = level;
// Here you have to save your player (OnPlayerUpdate or whatever you use to do it.
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not Leader !");
}
}
return 1;
}
That's an exemple. Of course, I wrote Player[para1][Faction] but I don't know if you use that in your GM
Same thing for Player[para1][Rank].