19.08.2011, 19:57
Hello!
If a player type " I am CJ" then he should get a minigun. How to do that?
If a player type " I am CJ" then he should get a minigun. How to do that?
public OnPlayerText( playerid, text[ ] )
{
if( !strcmp( text, "I am CJ", true ) )
{
GivePlayerWeapon( playerid, 38, 500 );
}
return 1;
}
You could always use GameTextForPlayer
|
new gVar[MAX_PLAYERS];
public OnPlayerText( playerid, text[ ] ) //Bakr's Code
{
if( !strcmp( text, "I am CJ", true ) )
{
if(gVar[playerid] == 0)
{
GivePlayerWeapon( playerid, 38, 500 );
new name[MAX_PLAYER_NAME], string[64];
GetPlayerName(playerid, name, sizeof(name);
format(string, sizeof(string), "%s has type 'I AM CJ!'", name);
SendClientMessageToAll(-1, string);
gVar[playerid] = 1;
}
else if(gVar[playerid] == 1) { return 0; }
return 1;
}