Posts: 233
Threads: 82
Joined: Jan 2011
pawn Код:
if (strcmp("/taxihead", cmdtext, true, 10) == 0)
{
new TaxiObject[MAX_VEHICLES];
new VID = GetPlayerVehicleID(playerid);
TaxiObject[VID] = CreateObject(19308, 50.0, 50.0, 30.0, 0, 0, 0);
AttachObjectToVehicle(TaxiObject[VID], VID, -0.05, 0.0, 0.9, 0.0, 0.1, 0.0);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s puts the taxi sign on the roof.", sendername);
SendClientMessage(playerid, COLOR_GRAD2, "You have attached the sign to the roof.");
return 1;
}
Fits a nice little taxi sign, however only fits on Premiers / Sultans.
So what could be done in order to improve this?
Posts: 298
Threads: 24
Joined: Oct 2012
Reputation:
0
The only thing I could thing of is to get the right coords for all the vehicles you wish to use, and then check if they are in that vehicle ID, and then set the object to the coord corresponding to that vehicle.
Posts: 233
Threads: 82
Joined: Jan 2011
How do I make it so the command works only if your in a CERTAIN car?
pawn Код:
}
if (strcmp("/taxihead", cmdtext, true, 10) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] == 10
{
new TaxiObject[MAX_VEHICLES];
new VID = GetPlayerVehicleID(playerid);
TaxiObject[VID] = CreateObject(19308, 50.0, 50.0, 30.0, 0, 0, 0);
[ I NEED TO PUT SOME CODE HERE TO RESTRICT TO A SULTAN ]
{
AttachObjectToVehicle(TaxiObject[VID], VID, -0.05, 0.0, 0.9, 0.0, 0.1, 0.0);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s puts the taxi sign on the roof.", sendername);
SendClientMessage(playerid, COLOR_GRAD2, "You have attached the sign to the roof.");
}
else {
SendClientMessage(playerid, COLOR_GRAD2, "You are not in a Sultan / part of the Taxi Cab Company!");
}
return 1;
}