Try this?
PHP код:
//CALLSIGN FILTERSCRIPT
#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#define COLOR_ORANGE 0xFF9500FF
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" CALLSIGN SCRIPT DAVMAN");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
new veh = GetPlayerVehicleID(playerid);
Delete3DTextLabel(veicolo_callsign_testo[veh]);
veicolo_callsign_status[veh] = 0;
return 1;
}
//******VARIABILI******//
new Text3D:veicolo_callsign_testo[MAX_VEHICLES];
new veicolo_callsign_status[MAX_VEHICLES];
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid,COLOR_ORANGE,"INFO: {FFFFFF}This server use Callsign Filterscript Davman");
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
new veh = GetPlayerVehicleID(playerid);
Delete3DTextLabel(veicolo_callsign_testo[veh]);
veicolo_callsign_status[veh] = 0;
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
new veh = GetPlayerVehicleID(vehicleid);
Delete3DTextLabel(veicolo_callsign_testo[veh]);
veicolo_callsign_status[veh] = 0;
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
#pragma tabsize 0
COMMAND:callsign(playerid,params[])
{
new veh = GetPlayerVehicleID(playerid);
if(IsPlayerInAnyVehicle(playerid))
{
if(isnull(params)) return SendClientMessage(playerid,COLOR_ORANGE,"INFO: {FFFFFF}/callsign [text]");
if(!veicolo_callsign_status[veh])
{
new string[128];
format(string,sizeof(string), "%s",params);
veicolo_callsign_testo[veh] = Create3DTextLabel(string, 0xFFFFFFFF, 0.0, 0.0, 0.0, 50.0, 0, 1);
Attach3DTextLabelToVehicle( veicolo_callsign_testo[veh], veh, -0.7, -1.9, -0.3);
veicolo_callsign_status[veh] = 1;
}
else
{
Delete3DTextLabel(veicolo_callsign_testo[veh]);
veicolo_callsign_status[veh] = 0;
return 1;
}
}
else
{
SendClientMessage(playerid,COLOR_ORANGE,"ERROR: {FFFFFF}You are not in a vehicle");
return 1;
}
return 1;
}
COMMAND:deletecallsign(playerid,params[])
{
new veh = GetPlayerVehicleID(playerid);
if(IsPlayerInAnyVehicle(playerid))
{
Delete3DTextLabel(veicolo_callsign_testo[veh]);
veicolo_callsign_status[veh] = 0;
}
else
{
SendClientMessage(playerid,COLOR_ORANGE,"ERROR: {FFFFFF}You are not in a vehicle");
}
return 1;
}