how to - 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: how to (
/showthread.php?tid=162566)
how to -
bartje01 - 23.07.2010
Hey guys, I have this command
pawn Код:
if(strcmp(cmd, "/setmode", true) == 0) {
SendRconCommand("changemode lvdm");
return 1;
}
I want to do it like /setmode [gamemodename]
How to do this? :P
thanks
Re: how to -
Blt950 - 24.07.2010
Not sure it works, but should.
And btw, this kind of command can't return a error message saying that the gamemode hasn't been found
pawn Код:
if(strcmp(cmd, "/setmode", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_WHITE," USAGE: /setmode [gamemode name]");
return 1;
}
new string[128]; // Remove this if you already have it defined
format(string,sizeof(string),"changemode %s",tmp);
SendRconCommand(string);
}
return 1;
}
Re: how to -
bartje01 - 24.07.2010
Thanks!, Code works fine,
Re: how to -
Vince - 24.07.2010
Dude ... Read your previous thread first before creating a new one.
I supplied you with a working command right there.
http://forum.sa-mp.com/showpost.php?...7&postcount=14
Re: how to -
bartje01 - 24.07.2010
OW vince. My appologizes. I didn't notice you made a /changemode [name].
I'm really sorry.