/votemap help. - 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: /votemap help. (
/showthread.php?tid=366449)
/votemap help. -
Champ - 06.08.2012
i want to use this command once per round. i added the command /votemap in the callback in which round starts. but it is showing an error.
pawn Код:
(555) : error 017: undefined symbol "cmdtext"
pawn Код:
public StartedNewRound(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
SpawnPlayer ( i ) ;
switch ( Map )
{
case 0:{
GameMinutes =5;
GameSeconds =0;
if(!strcmp(cmdtext, "/votemap", true))
{
ShowPlayerDialog(playerid,GM,DIALOG_STYLE_LIST,"[SvR] Map Voting"," Map 1: \n Map 2: \n Map 3:\n Map 4:\n Map 5:\n Map 6: \n Map 7:","Select","Cancel");
}
else return SendClientMessage(playerid, 0x0259EAAA, "you can use this command once per round!");
}
Re: /votemap help. -
Devilxz97 - 06.08.2012
pawn Код:
public StartedNewRound(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
SpawnPlayer ( i ) ;
switch ( Map )
{
case 0:
{
GameMinutes =5;
GameSeconds =0;
new cmd[256];
if(!strcmp(cmd, "/votemap", true))
{
ShowPlayerDialog(playerid,GM,DIALOG_STYLE_LIST,"[SvR] Map Voting"," Map 1: \n Map 2: \n Map 3:\n Map 4:\n Map 5:\n Map 6: \n Map 7:","Select","Cancel");
}
else return SendClientMessage(playerid, 0x0259EAAA, "you can use this command once per round!");
}
try this
Re: /votemap help. -
Ranama - 06.08.2012
nah, that won't work Devilxz97.
He'll have to split it up, he can't use cmd functions inside another function you have to use it within the OnPlayerCommandText() callback
He could do it like:
when it's time to vote he sets a local variable to 1, and in the command it checks if the varible is one, othervise it sends a error message, then he use local variables to store what map they voted on to, and when the timer fucntion is set he change to that map or something
Hoe you understand something