14.08.2010, 18:48
Hi guys and girls,
I have recently began rescripting my "assistance" job class section for my server, and have come accross a problem, i cannot get my /towcar command to work, it executes (because it doesnt say "SERVER: Unknown Command"), however it doesnt attach the car to the tow truck, can someone help?
Here is the "assistance" section of my OnPlayerCommandText callback:
I dont see whats wrong, unless its my A_Vehicle thing,
Can anyone else see the problem?
Thanks
Ash
I have recently began rescripting my "assistance" job class section for my server, and have come accross a problem, i cannot get my /towcar command to work, it executes (because it doesnt say "SERVER: Unknown Command"), however it doesnt attach the car to the tow truck, can someone help?
Here is the "assistance" section of my OnPlayerCommandText callback:
pawn Код:
//Assistance...
new Float:A_x, Float:A_y, Float:A_z;
new A_Vehicle;
if(strcmp("/assistance", cmdtext) == 0)
{
if(IsPlayerInAnyVehicle(playerid) == 1)
{
SendClientMessage(playerid, WORK, "Assistance has been called");
SendClientMessage(playerid, WORK, "Just sit back, and wait!");
//Call Assistance
A_Vehicle = GetPlayerVehicleID(playerid);
GetVehiclePos(A_Vehicle, A_x, A_y, A_z);
new AssistanceMessage[128], PlayersName[128];
GetPlayerName(playerid, PlayersName, sizeof(PlayersName));
format(AssistanceMessage, sizeof(AssistanceMessage), "%s needs assistance, go and help!", PlayersName);
for(new i; i < MAX_PLAYERS; i++)
{
if(GetPlayerTeam(i) == 2)
{
SendClientMessage(i, WORK, AssistanceMessage);
SetPlayerCheckpoint(i, A_x, A_y, A_z, 15);
}
}
}
return 1;
}
if(strcmp("/repaircar", cmdtext) == 0)
{
if(GetPlayerTeam(playerid) == 2)
{
if(IsPlayerInRangeOfPoint(playerid, 15, A_x, A_y, A_z) == 1)
{
RepairVehicle(A_Vehicle);
SetVehicleHealth(A_Vehicle, 100.0);
}
}
return 1;
}
if(strcmp("/towcar", cmdtext) == 0)
{
if(GetPlayerTeam(playerid) == 2)
{
if(IsPlayerInRangeOfPoint(playerid, 15, A_x, A_y, A_z) == 1)
{
AttachTrailerToVehicle(A_Vehicle, GetPlayerVehicleID(playerid));
}
}
return 1;
}
//------------------------------------------
Can anyone else see the problem?
Thanks
Ash