SA-MP Forums Archive
Command help. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Command help. (/showthread.php?tid=349298)



Command help. - tiernantheman - 08.06.2012

Hey guys, once again im having some problems with my command. When I type to execute the command nothing happens. Would be great if you guys could help me thanks. Here's the code.

pawn Код:
YCMD:delivergoods(playerid, params[])
{
    if(IsPlayerInVehicle(playerid, 414))
    if(IsPlayerInRangeOfPoint(playerid, 15.0, -1473.9618, 2648.9451, 55.9296))
    {
        if(PlayerInfo[playerid][Job] == 2)
        {
            CP[playerid] = 1;
            SetPlayerCheckpoint(playerid, 571.0456,1218.3618,11.7564, 3.0);
            SendClientMessage(playerid, COLOR_GREEN, "You have started your delivery, please deliver the goods to the checkpoint marked on your map!");
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_GREEN, "You are not near the trucker factory in El Quadbrados!");
    }
    return 1;
}



Re: Command help. - MadeMan - 08.06.2012

Try this

pawn Код:
YCMD:delivergoods(playerid, params[])
{
    new vehicleid = GetPlayerVehicleID(playerid);
    new modelid = GetVehicleModel(vehicleid);
    if(PlayerInfo[playerid][Job] != 2) return SendClientMessage(playerid, COLOR_GREEN, "You don't have the job!");
    if(modelid != 414) return SendClientMessage(playerid, COLOR_GREEN, "You are not in the vehicle!");
    if(!IsPlayerInRangeOfPoint(playerid, 15.0, -1473.9618, 2648.9451, 55.9296))
        return SendClientMessage(playerid, COLOR_GREEN, "You are not near the trucker factory in El Quadbrados!");
    CP[playerid] = 1;
    SetPlayerCheckpoint(playerid, 571.0456,1218.3618,11.7564, 3.0);
    SendClientMessage(playerid, COLOR_GREEN, "You have started your delivery, please deliver the goods to the checkpoint marked on your map!");
    return 1;
}



Re: Command help. - tiernantheman - 08.06.2012

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
Try this

pawn Код:
YCMD:delivergoods(playerid, params[])
{
    new vehicleid = GetPlayerVehicleID(playerid);
    new modelid = GetVehicleModel(vehicleid);
    if(PlayerInfo[playerid][Job] != 2) return SendClientMessage(playerid, COLOR_GREEN, "You don't have the job!");
    if(modelid != 414) return SendClientMessage(playerid, COLOR_GREEN, "You are not in the vehicle!");
    if(!IsPlayerInRangeOfPoint(playerid, 15.0, -1473.9618, 2648.9451, 55.9296))
        return SendClientMessage(playerid, COLOR_GREEN, "You are not near the trucker factory in El Quadbrados!");
    CP[playerid] = 1;
    SetPlayerCheckpoint(playerid, 571.0456,1218.3618,11.7564, 3.0);
    SendClientMessage(playerid, COLOR_GREEN, "You have started your delivery, please deliver the goods to the checkpoint marked on your map!");
    return 1;
}
Thank you very much that worked. +REP