Script help
#3

Problem:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/joinjob", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid, -1,"Congratulation, you have joined the Pizza boy job");
        Pizzajob = 1;
    }
        else SendClientMessage(playerid, -1, "You already joined this job, use /pizzahelp for more informations");
} // issue was here, you've closed the public, so the following lines are not inside it
    if (strcmp("/pizzahelp", cmdtext, true, 10) == 0)
    {
           SendClientMessage(playerid, 0x37FF00FF, "   --------------------  Pizzaboy job help  --------------------  ");
           SendClientMessage(playerid, 0xF5FF00FF, "[JOBHELP]:Get on a pizza bike to start the job! ");
           SendClientMessage(playerid, 0x37FF00FF, "[JOBHELP]:Deliver the Pizza to the Checkpoint then drive the bike back to Well stacked pizza");
           SendClientMessage(playerid, 0xF5FF00FF, "[JOBHELP]:Notice:You earn some bucks as tips when you deliver the pizza.");
    }
    if (strcmp("/deliverpizza", cmdtext, true, 10) == 0)
    {
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)
    {
        if ((Pizzajob) == 1)
        {
       
            new rand,Float:X, Float:Y, Float:Z;
            rand = random(4);
            switch(rand)
            {
                   case 0:{X = 2332.1140;Y = -1680.7076;Z = 13.7506;}
                   case 1:{X = 2508.3562;Y = -1654.8031;Z = 13.8660;}
                   case 2:{X = 2141.2703;Y = -1611.0664;Z = 13.8660;}
                   case 3:{X = 1092.9705;Y = -1093.6687;Z = 25.5253;}
            }
            SetPlayerCheckpoint(playerid, X, Y, Z, 5.0);
            SendClientMessage(playerid, 0x37FF00FF," Drive the pizza bike to the checkpoint then bring back the bike!");
                   Pizza = 1;
}
else SendClientMessage(playerid,0xF5FF00FF,"You need to be a Pizza boy to use this command");
}
else  SendClientMessage(playerid,0xF5FF00FF," you have to be on a pizza bike to use this Command");
    }
    return 1;
}
Solution:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/joinjob", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid, -1,"Congratulation, you have joined the Pizza boy job");
        Pizzajob = 1;
    }
    else if (strcmp("/pizzahelp", cmdtext, true, 10) == 0)
    {
           SendClientMessage(playerid, 0x37FF00FF, "   --------------------  Pizzaboy job help  --------------------  ");
           SendClientMessage(playerid, 0xF5FF00FF, "[JOBHELP]:Get on a pizza bike to start the job! ");
           SendClientMessage(playerid, 0x37FF00FF, "[JOBHELP]:Deliver the Pizza to the Checkpoint then drive the bike back to Well stacked pizza");
           SendClientMessage(playerid, 0xF5FF00FF, "[JOBHELP]:Notice:You earn some bucks as tips when you deliver the pizza.");
    }
    else if (strcmp("/deliverpizza", cmdtext, true, 10) == 0)
    {
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)
        {
            if ((Pizzajob) == 1)
            {
       
                    new rand,Float:X, Float:Y, Float:Z;
                    rand = random(4);
                    switch(rand)
                    {
                        case 0:{X = 2332.1140;Y = -1680.7076;Z = 13.7506;}
                        case 1:{X = 2508.3562;Y = -1654.8031;Z = 13.8660;}
                        case 2:{X = 2141.2703;Y = -1611.0664;Z = 13.8660;}
                        case 3:{X = 1092.9705;Y = -1093.6687;Z = 25.5253;}
                    }
                    SetPlayerCheckpoint(playerid, X, Y, Z, 5.0);
                    SendClientMessage(playerid, 0x37FF00FF," Drive the pizza bike to the checkpoint then bring back the bike!");
                    Pizza = 1;
            }
        }
    }
    return 1;
}
Note, use zcmd if you want to show the error messages without causing problems.
Reply


Messages In This Thread
Script help - by EthanMason - 11.11.2013, 12:22
Re: Script help - by SAMProductions - 11.11.2013, 12:34
Re: Script help - by Loot - 11.11.2013, 12:35

Forum Jump:


Users browsing this thread: 1 Guest(s)