Need help with callsign
#1

Can someone transfer this to strcmp the server uses strcmp not Command:
And yes i know Command: is a much better command processer. But I dont really care i just need help fixing this command! Thanks to all and +Rep to whomever helps.

Quote:

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;
}

Reply
#2

Testa esse comando, se houver algum erro me avise.
PHP код:
if(strcmp(cmd,"/callsign",true)==0)
    {
        
strmid(tmp,cmdtext,9,strlen(cmdtext));
        if(!
strlen(tmp))
        {
            
SendClientMessage(playeridCOLOR_ORANGE"INFO: {FFFFFF}/callsign [text]");
            return 
1;
        }
        else
        {
            new 
veh GetPlayerVehicleID(playerid);
            if(
IsPlayerInAnyVehicle(playerid))
            {
                if(!
veicolo_callsign_status[veh])
                {
                    new 
string[128];
                    
format(string,sizeof(string), "%s",tmp);
                    
veicolo_callsign_testo[veh] = Create3DTextLabel(string0xFFFFFFFF0.00.00.050.001);
                    
Attach3DTextLabelToVehicleveicolo_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;
            }
            }
    } 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)