SA-MP Forums Archive
[Help]Choosing for the next gamemode - 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: [Help]Choosing for the next gamemode (/showthread.php?tid=134714)



[Help]Choosing for the next gamemode - MinZ|Spark - 17.03.2010

Can someone help me with choosing for the next gm scripts?

I mean,when Im playing,then I want to set a GM for the next GM,get it?

Like /next [GMID/NAME].I dont want it will automaticly change GM when playing on any GM.I want , after Im playing on this GM,then the GM,which I set it before start.

Is it possible to do that?
Or you not get it?
P.S: Sorry for bad english :P


Re: [Help]Choosing for the next gamemode - MinZ|Spark - 17.03.2010

Can anyone help here?


Re: [Help]Choosing for the next gamemode - andrewp - 17.03.2010

SendRconCommand("changemode *gamemode name*");

Maybe?


Re: [Help]Choosing for the next gamemode - MinZ|Spark - 17.03.2010

Quote:
Originally Posted by AndrewP
SendRconCommand("changemode *gamemode name*");

Maybe?
Hmmm...Well,what's the cmds?


Re: [Help]Choosing for the next gamemode - Jakku - 17.03.2010

pawn Код:
if(strcmp(cmd, "/changemode", true) == 0) {
if (strlen(gm)==0) {
SendClientMessage(playerid, COLOR_COLOR, "Usage: /changemode [gamemode_name]");
return 1;
}
new gm[120];
new string[120];
format(string, 120, "changemode %s", gm);
SendRconCommand(string);
return 1;
}
Try this


Re: [Help]Choosing for the next gamemode - MinZ|Spark - 17.03.2010

Fail. Result:

Код:
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(91) : error 017: undefined symbol "cmd"
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(92) : error 017: undefined symbol "gm"
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(93) : error 017: undefined symbol "COLOR_COLOR"
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(103) : warning 217: loose indentation
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(103) : error 029: invalid expression, assumed zero
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(103) : error 004: function "OnPlayerEnterVehicle" is not implemented
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(108) : warning 225: unreachable code
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(108) : error 029: invalid expression, assumed zero
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(108) : error 004: function "OnPlayerExitVehicle" is not implemented
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(113) : warning 225: unreachable code
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(113) : error 029: invalid expression, assumed zero
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(113) : error 004: function "OnPlayerStateChange" is not implemented
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(118) : warning 225: unreachable code
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(118) : error 029: invalid expression, assumed zero
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(118) : error 004: function "OnPlayerEnterCheckpoint" is not implemented
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(123) : warning 225: unreachable code
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(123) : error 029: invalid expression, assumed zero
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(123) : error 004: function "OnPlayerLeaveCheckpoint" is not implemented
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(128) : warning 225: unreachable code
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(128) : error 029: invalid expression, assumed zero
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(128) : error 004: function "OnPlayerEnterRaceCheckpoint" is not implemented
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(133) : warning 225: unreachable code
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(133) : error 029: invalid expression, assumed zero
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(133) : error 004: function "OnPlayerLeaveRaceCheckpoint" is not implemented
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(138) : warning 225: unreachable code
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(138) : error 029: invalid expression, assumed zero
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(138) : error 004: function "OnRconCommand" is not implemented
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(143) : warning 225: unreachable code
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(143) : error 029: invalid expression, assumed zero
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(143) : error 004: function "OnPlayerRequestSpawn" is not implemented
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(148) : warning 225: unreachable code
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(148) : error 029: invalid expression, assumed zero
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(148) : error 004: function "OnObjectMoved" is not implemented
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(153) : warning 225: unreachable code
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(153) : error 029: invalid expression, assumed zero
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(153) : error 004: function "OnPlayerObjectMoved" is not implemented
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(158) : warning 225: unreachable code
C:\Documents and Settings\user\Desktop\SA-MP\filterscripts\changegm.pwn(158) : error 029: invalid expression, assumed zero

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


26 Errors.



Re: [Help]Choosing for the next gamemode - aircombat - 17.03.2010

Код:
if (strcmp("/changemode", cmdtext, true) == 0) {
new gm[120];
new string[120];
if (strlen(gm)==0) {
SendClientMessage(playerid, COLOR_COLOR, "Usage: /changemode [gamemode_name]");
return 1;
}
format(string, 120, "changemode %s", gm);
SendRconCommand(string);
return 1;
}



Re: [Help]Choosing for the next gamemode - MinZ|Spark - 18.03.2010

Hmmm,where do I need to put it to?
SendRCONCommand?
OnPlayerCommandText?



Re: [Help]Choosing for the next gamemode - XGh0stz - 18.03.2010

This must really be broken down for you if you don't even know where to place the given code...

I'd search out & learn about strtok as a start

The given code won't work completely alone, but it would be put under OnPlayerCommandText
strtok is a function that can read words between spaces, example:
/changemode mario

strtok used only once will first find '/changemode'
Use it again, it would find 'mario'
Use it once more it would find nothing because nothing is after mario...

It's best just to search out strtok & read up on it though