All Default Commands stopped working
#2

OnPlayerCommandText (whole function) returns 0; , but inside the command (From inside) returns 1;
Read: https://sampwiki.blast.hk/wiki/OnPlayerCommandText
So, It would be:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/tcar", cmdtext, true, 5) == 0)
    {
        new Float:x,Float:y,Float:z;
        new Float:a;
        GetPlayerPos(playerid, x, y, z);
        GetPlayerFacingAngle(playerid, a);
        Tcar=CreateVehicle(560,x, y+5, z, a,111,103, -1);
        AddVehicleComponent(Tcar, 1138);
        AddVehicleComponent(Tcar, 1026);
        AddVehicleComponent(Tcar, 1033);
        AddVehicleComponent(Tcar, 1010);
        AddVehicleComponent(Tcar, 1082);
        AddVehicleComponent(Tcar, 1141);
        AddVehicleComponent(Tcar, 1169);
        ChangeVehiclePaintjob(Tcar, 2);
        return 1;
    }
    if (strcmp("/tboat", cmdtext, true, 6) == 0)
    {
        new Float:x,Float:y,Float:z;
        new Float:a;
        GetPlayerPos(playerid, x, y, z);
        GetPlayerFacingAngle(playerid, a);
        Tboat=CreateVehicle(430,x, y+5, z, a,111,103, -1);
        return 1;
    }
    if (strcmp("/tjet", cmdtext, true, 5) == 0)
    {
        new Float:x,Float:y,Float:z;
        new Float:a;
        GetPlayerPos(playerid, x, y, z);
        GetPlayerFacingAngle(playerid, a);
        Tjet=CreateVehicle(520,x, y+5, z, a,111,103, -1);
        return 1;
    }
    if (strcmp("/tcash", cmdtext, true, 6) == 0)
    {
        GivePlayerMoney(playerid, 9999999);
        return 1;
    }
    if(strcmp(cmdtext, "/me", true, 3) == 0)
    {
        if(!cmdtext[3])return SendClientMessage(playerid, COLOR_RED, "USAGE: /me [text]");
        new str[128];
        GetPlayerRPName(playerid, str, sizeof(str));
        format(str, sizeof(str), "*%s %s", str, cmdtext[4]);
        SendLocalMessage(playerid, COLOR_PURPLE, 7, str);
        return 1;
    }
    return 0;
}
Reply


Messages In This Thread
All Default Commands stopped working - by Aerotactics - 14.02.2014, 07:50
Re: All Default Commands stopped working - by Sawalha - 14.02.2014, 07:53
Re: All Default Commands stopped working - by Aerotactics - 14.02.2014, 08:02
Re: All Default Commands stopped working - by Threshold - 14.02.2014, 10:31

Forum Jump:


Users browsing this thread: 1 Guest(s)