12.09.2018, 01:49
Make NPC respond to you
Make NPC write a command
Not sure if the last snippet will work since I wrote it off phone but neverthless it’s funny how you can experiment with NPCs.
Also this is just an entertaining snippet.
Код:
public OnPlayerText(playerid, text[])
{
if (strfind(text, "I need a taxi") != -1)
{
new string[80], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new Float:X, Float:Y, Float:Z, Float:Angle;
format(string, sizeof(string), "Hey %s taxi is in your way!", name);
SendChat(string);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Angle);
Createvehicle// here
}
return 1;
}
Код:
public OnPlayerText(playerid, text[])
{
if (strfind(text, "fuck you") != -1)
{
new string[80], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
SendCommand("/kick %i", playerid);
format(string, sizeof(string), "Hey %s Fuck off!", name); // you can set a timer so the player can see the message
SendChat(string);
}
return 1;
}
Also this is just an entertaining snippet.
