SA-MP Forums Archive
whats wrong with this? - 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: whats wrong with this? (/showthread.php?tid=193678)



whats wrong with this? - farris - 27.11.2010

the problem is when i type hello it brings the resetaughnt and the greeting

public OnPlayerText(playerid, text[])
{
if (strfind(text, "hello") != -1)
{
SetTimerEx("greeting", 1000, false, "d", playerid);
}
if (strfind(text, "hi") != -1)
{
SetTimerEx("greeting", 1000, false, "d", playerid);
}
if (strfind(text, "watsup") != -1)
{
SetTimerEx("greeting", 1000, false, "d", playerid);
}
if (strfind(text, "sup") != -1)
{
SetTimerEx("greeting", 1000, false, "d", playerid);
}
if (strfind(text, "Wheres a good place to eat?") || strfind(text, "I'm Hungry") || strfind(text, "where can i get something to eat")|| strfind(text, "what do you reccomend for food?")!= -1)
{
switch(random(3))
{
case 0:
{
SendPlayerMessageToPlayer(playerid,0,"The steak house is a good place in north LV near the fire station.");
}
case 1:
{
SendPlayerMessageToPlayer(playerid,0,"Theres an awesome buffet at the four dragons just southbound from here.");
}
case 2:
{
SendPlayerMessageToPlayer(playerid,0,"Theres a donut shop all the way southbound this road to the right!");
}
}
return 0;
}
return 1;
}
public greeting(playerid)
{
if(IsPlayerNPC(playerid)) return 1;
SendPlayerMessageToPlayer(playerid,0,"Hi,I'm Dave; How can I help you?");
return 1;
}


Re: whats wrong with this? - randomkid88 - 27.11.2010

Put the whole code in pawn and /pawn tags (put them between []) in the future to help it be more legible.

And can you explain a little more what the issue is?