SA-MP Forums Archive
public OnPlayerText(playerid, text[]) - 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: public OnPlayerText(playerid, text[]) (/showthread.php?tid=499282)



public OnPlayerText(playerid, text[]) - GrandParadise - 07.03.2014

Why does pawno crash when i try to compile this callback?

Код:
public OnPlayerText(playerid, text[])
{
    new message[128];
    format(message, sizeof(message), "%s says: %s", GetName(playerid), text);
    ProxDetector(30.0, playerid, message, -1);
    }
        case 0: ApplyAnimation(playerid,"PED","IDLE_CHAT",4.1,0,1,1,1,1);
        case 1: ApplyAnimation(playerid, "GANGS", "prtial_gngtlkA", 3.1,0,1,1,1,1);
        case 2: ApplyAnimation(playerid, "GANGS", "prtial_gngtlkB", 3.1,0,1,1,1,1);
        case 3: ApplyAnimation(playerid, "GANGS", "prtial_gngtlkC", 3.1,0,1,1,1,1);
        case 4: ApplyAnimation(playerid, "GANGS", "prtial_gngtlkD", 3.1,0,1,1,1,1);
        case 5: ApplyAnimation(playerid, "GANGS", "prtial_gngtlkE", 3.1,0,1,1,1,1);
        case 6: ApplyAnimation(playerid, "GANGS", "prtial_gngtlkF", 3.1,0,1,1,1,1);
        case 7: ApplyAnimation(playerid, "GANGS", "prtial_gngtlkG", 3.1,0,1,1,1,1);
        case 8: ApplyAnimation(playerid, "GANGS", "prtial_gngtlkH", 3.1,0,1,1,1,1);
		}
        new time=strlen(text)*100;
        SetTimerEx("StopTalking",time,0,"i",playerid);
	    }
        return 1;
}



Re: public OnPlayerText(playerid, text[]) - Scenario - 07.03.2014

Look at your braces. There's no conditional statement to follow with them.


Re: public OnPlayerText(playerid, text[]) - BKarner - 07.03.2014

1) There's no switch.
2) You're not opening so why close?


Re: public OnPlayerText(playerid, text[]) - XK - 07.03.2014

You didnt open any yhing to close it....