/setgm - 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: /setgm (
/showthread.php?tid=163106)
/setgm -
Kitten - 26.07.2010
Solved
Re: /setgm -
Kitten - 26.07.2010
any help i have to go soon.....
Re: /setgm -
willsuckformoney - 26.07.2010
can u send what u has for ur /setgm please
Re: /setgm -
Kitten - 26.07.2010
Solved
Re: /setgm -
willsuckformoney - 26.07.2010
realize this is not exactly what you wanted but it helps
have no tested but compiles fine
pawn Код:
//AT TOP OF ONPLAYERCOMMANDTEXT
new tmp[256],cmd[256],idx;
cmd = strtok(cmdtext,idx);
tmp = strtok(cmdtext,idx);
if(!strcmp(cmd,"/Setgm",true))
{
if(IsPlayerAdmin(playerid))
{
if(!strlen(tmp)||strval(tmp)<0||strval(tmp)>3) return SendClientMessage(playerid,COLOR_MESSAGES,"USEAGE: /Setgm [1 - 3]");
switch(strval(tmp))
{
case 1:
{
SendRconCommand("changemode Race 1");
SendRconCommand("changemode");
}
case 2:
{
SendRconCommand("changemode Race 2");
SendRconCommand("changemode");
}
case 3:
{
SendRconCommand("changemode Race 3");
SendRconCommand("changemode");
}
}
}
else
{
SendClientMessage(playerid, COLOR, "You are NOT an admin");
}
return 1;
}
reply if works or not
Re: /setgm -
willsuckformoney - 26.07.2010
* willsuckformoney forgot this put this at bottom of script
pawn Код:
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
Re: /setgm -
Kitten - 26.07.2010
thanks it works and i already had the strtok
Re: /setgm -
willsuckformoney - 26.07.2010
wow it really worked? lol i tested it on mine and it fail lol maybe cuz i edited it a little ^^
Re: /setgm -
Kitten - 26.07.2010
Solved
Re: /setgm -
willsuckformoney - 26.07.2010
cool lol