30.01.2014, 11:55
I made it so if you want to sit as passenger in a Shamal you will spawn inside the Shamal interior.
That works like it should.
But since the pilot and passengers then couldnt comunicate I tried to make it so it will send a message to the pilot/passenger if the shamal you're in has the same vehicle ID. It works for the pilot but not for the passengers.. Like you can see on the pics below..
As you can see it says 'Pilot: Tyler_Acres Says: test' That message is being sent to the passengers too.
But when I'm passenger and try to talk I dont get the message 'Passenger Tyler_Acres Says: test' I only get the normal message(which i shouldnt..)
And here is the code under OnPlayerText.
EDIT: IsInShml is for passengers and IsShmlPil is for the pilot. Both are set when you enter a vehicle
That works like it should.
But since the pilot and passengers then couldnt comunicate I tried to make it so it will send a message to the pilot/passenger if the shamal you're in has the same vehicle ID. It works for the pilot but not for the passengers.. Like you can see on the pics below..
As you can see it says 'Pilot: Tyler_Acres Says: test' That message is being sent to the passengers too.
But when I'm passenger and try to talk I dont get the message 'Passenger Tyler_Acres Says: test' I only get the normal message(which i shouldnt..)
And here is the code under OnPlayerText.
pawn Код:
new vehicle = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicle) == 519)
{
for( new i = 0; i != MAX_PLAYERS; i++ )
{
if(GetPlayerVehicleID(i) == vehicle)
{
if(IsShmlPil[i] == vehicle)
{
if(PlayerInfo[playerid][pAdminDuty] == 0 && PlayerInfo[playerid][pMaskuse] == 0)
{
format(string, sizeof(string), "{157DEC}(IC){FFFFFF} %s Says: %s", sendername, text);
SetPlayerChatBubble(playerid, string, COLOR_WHITE, 8.5, 8000);
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
format(string, sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s (Local): %s",d1,m1,y1,h1,mi1,s1, sendername, text);
format(string, sizeof(string), "Pilot: %s Says: %s", sendername, text);
SCM(i, 0xD7DFF3AA, string);
ChatLog(string);
}
else if(PlayerInfo[playerid][pAdminDuty] == 0 && PlayerInfo[playerid][pMaskuse] == 1)
{
format(string, sizeof(string), "{157DEC}(IC){FFFFFF} Stranger Says: %s", text);
SetPlayerChatBubble(playerid, string, COLOR_WHITE, 8.5, 8000);
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
format(string, sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s (Local Masked): %s",d1,m1,y1,h1,mi1,s1, sendername, text);
format(string, sizeof(string), "Pilot: Stranger Says: %s", text);
SCM(i, 0xD7DFF3AA, string);
ChatLog(string);
}
else if(PlayerInfo[playerid][pAdminDuty] == 1 && PlayerInfo[playerid][pMaskuse] == 0)
{
format(string, sizeof(string), "{157DEC}(A){FFFFFF} Admin Says: %s", text);
SetPlayerChatBubble(playerid, string, COLOR_NICERED, 8.5, 8000);
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
format(string, sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s (Local Admin): %s",d1,m1,y1,h1,mi1,s1, sendername, text);
format(string, sizeof(string), "Pilot: Admin %s Says: %s",sendername, text);
SCM(i, 0xD7DFF3AA, string);
ChatLog(string);
}
}
else if(IsInShml[i] == vehicle)
{
if(PlayerInfo[playerid][pAdminDuty] == 0 && PlayerInfo[playerid][pMaskuse] == 0)
{
format(string, sizeof(string), "Passenger %s Says: %s", sendername, text);
SCM(i, 0xD7DFF3AA, string);
ChatLog(string);
}
else if(PlayerInfo[playerid][pAdminDuty] == 0 && PlayerInfo[playerid][pMaskuse] == 1)
{
format(string, sizeof(string), "Passenger Stranger Says: %s", text);
SCM(i, 0xD7DFF3AA, string);
ChatLog(string);
}
else if(PlayerInfo[playerid][pAdminDuty] == 1 && PlayerInfo[playerid][pMaskuse] == 0)
{
format(string, sizeof(string), "Passenger Admin %s Says: %s",sendername, text);
SCM(i, 0xD7DFF3AA, string);
ChatLog(string);
}
}
}
}