Commanding a player to do /me -
Bam23 - 26.03.2011
if(strcmp(cmd, "/engineon",true) == 0) {
new vid = GetPlayerVehicleID(playerid);
if(vid != INVALID_VEHICLE_ID) {
SendClientMessage(playerid, COLOR_GREEN, "You Start Up The Vehicle's Engine");
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,al arm,doors,bonnet,boot,objective);
}
return 1;
}
I want to change the "You Start Up The Vehicle's Engine"
to make the player say /me Turns the engine on with keys
Re: Commanding a player to do /me -
Zh3r0 - 26.03.2011
pawn Код:
if ( strcmp( cmd, "/engineon" ) )
{
if ( !IsPlayerInAnyVehicle( playerid ) )
return SendClientMessage( playerid, 0xFF2020FF, "ERROR: You need to be in a vehicle to use this command!" );
GetVehicleParamsEx( GetPlayerVehicleID( playerid ),
engine,
lights,
alarm,
doors,
bonnet,
boot,
objective);
SetVehicleParamsEx( GetPlayerVehicleID( playerid ),
VEHICLE_PARAMS_ON,
lights,
alarm,
doors,
bonnet,
boot,
objective);
new Name[ 24 ], Str[ 100 ];
GetPlayername( playerid, Name, 24 );
format( Str, 100, "%s turns on the engine with keys", Name );
SendClientMessageToAll( 0xFF00FFFF, Str );
return 1;
}
Re: Commanding a player to do /me -
Medal Of Honor team - 26.03.2011
add this
pawn Код:
new string[128];
new namer[MAX_PLAYER_NAME];
GetPlayerName(playerid, namer, sizeof(namer))
format(string, sizeof(string), "%s Start Up The Vehicle's Engine", namer);
ProxDetector(30.0,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
pawn Код:
public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
if(IsPlayerConnected(playerid))
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
if(col1 == COLOR_PURPLE || col2 == COLOR_PURPLE
|| col3 == COLOR_PURPLE || col4 == COLOR_PURPLE
|| col5 == COLOR_PURPLE)
{
SetPlayerChatBubble(playerid, string, COLOR_PURPLE, radi, 5000);
}
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
foreach (Player, i)
{
if(gPlayerLogged[i] == 1)
{
if(!BigEar[i])
{
GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
{
if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
{
SendClientMessage(i, col1, string);
}
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
{
SendClientMessage(i, col2, string);
}
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
{
SendClientMessage(i, col3, string);
}
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
{
SendClientMessage(i, col4, string);
}
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
{
SendClientMessage(i, col5, string);
}
}
}
else
{
SendClientMessage(i, col1, string);
}
}
}
}
return 1;
}
Re: Commanding a player to do /me -
Joe Staff - 26.03.2011
Or just add
pawn Код:
OnPlayerCommandText(playerid,"/me starts his engine");
Re: Commanding a player to do /me -
Bam23 - 26.03.2011
I already have the
new engine,lights,alarm,doors,bonnet,boot,objective;
Is there a way to just replace the
SendClientMessage(playerid, COLOR_GREEN, "You Start Up The Vehicle's Engine");
If so just put what i need to copy and where and what i need to paste over