SA-MP Forums Archive
hmm ... can you tell me why ? - 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: hmm ... can you tell me why ? (/showthread.php?tid=87425)



hmm ... can you tell me why ? - Takumi.WS - 20.07.2009

Look at this code :

Код:
   
public OnPlayerCommandText(playerid, cmdtext[])
if(strcmp("/pizzajob", cmdtext, true) == 0)
	{
    SendClientMessage(playerid,COLOR_RED, "HINT: Follow the marker on the map to get your pizzaboy job !");
		SetPlayerCheckpoint(playerid, 2083.217, 2223.526, 11.023 );
		return 0;
	}

	   if(strcmp("/towtruckjob", cmdtext, true) == 0)
	{
    SendClientMessage(playerid,COLOR_RED, "HINT: Follow the marker on the map to get your Tow truck driver job !");
		SetPlayerCheckpoint(playerid, 1942.5308, 2163.4653, 10.8203 );
		return 1;
	}
return 0;
}
But in-game when i type /pizzajob, or /towtruckjob, it shows the message, then : SERVER: Unknown Command

Can you tell me why ?


Re: hmm ... can you tell me why ? - yezizhu - 20.07.2009

edit to

Код:
   
public OnPlayerCommandText(playerid, cmdtext[])
if(strcmp("/pizzajob", cmdtext, true) == 0)
	{
    SendClientMessage(playerid,COLOR_RED, "HINT: Follow the marker on the map to get your pizzaboy job !");
		SetPlayerCheckpoint(playerid, 2083.217, 2223.526, 11.023 );
		return 1;
	}

	   else if(strcmp("/towtruckjob", cmdtext, true) == 0)
	{
    SendClientMessage(playerid,COLOR_RED, "HINT: Follow the marker on the map to get your Tow truck driver job !");
		SetPlayerCheckpoint(playerid, 1942.5308, 2163.4653, 10.8203 );
		return 1;
	}
return 0;
}



Re: hmm ... can you tell me why ? - Takumi.WS - 20.07.2009

Still the same problem


Re: hmm ... can you tell me why ? - XPlatform - 20.07.2009

try changing return 0; to return 1;


Re: hmm ... can you tell me why ? - yezizhu - 20.07.2009

Post whole OnPlayerCommandText by pastebin


Re: hmm ... can you tell me why ? - Takumi.WS - 20.07.2009

here is the whole OnPlayerCommandText .

http://pastebin.com/f42916f39

and CodeMatrix i tried, but didn't work


Re: hmm ... can you tell me why ? - yezizhu - 20.07.2009

Hmmm, have no error in OnPlayerCommandText.
But I've noticed that doesn't have "towtruckjob" in it.
Are you sure you posted right code in pastebin?


Re: hmm ... can you tell me why ? - Annihalation - 20.07.2009

if it is a filterscript, then that is why

if its a filterscript you need to go onto your Game Mode file and put in where it says OnPlayerCommandText

Код:
if (strcmp("/pizzaboy", cmdtext, true)==0) return 1;
if (strcmp("/towtruckjob", cmdtext, true)==0) return 1;
if you put that in your game mode file, then the actual server file will recognize it. If you are already in your game mode file, then i have no idea what to tell you


Re: hmm ... can you tell me why ? - Takumi.WS - 20.07.2009

Quote:
Originally Posted by yezizhu
Hmmm, have no error in OnPlayerCommandText.
But I've noticed that doesn't have "towtruckjob" in it.
Are you sure you posted right code in pastebin?
I just deleted the towtruckjob to test if pizzajob will work .
It's the right code


Re: hmm ... can you tell me why ? - Takumi.WS - 20.07.2009

Quote:
Originally Posted by Annihalation
if it is a filterscript, then that is why

if its a filterscript you need to go onto your Game Mode file and put in where it says OnPlayerCommandText

Код:
if (strcmp("/pizzaboy", cmdtext, true)==0) return 1;
if (strcmp("/towtruckjob", cmdtext, true)==0) return 1;
if you put that in your game mode file, then the actual server file will recognize it. If you are already in your game mode file, then i have no idea what to tell you
It's in the GM, not the FS