/deal cmd with names?
#9

Actually there is only one little mistake and its quit obviously if you test the command

But it doesnt seems that you are able to fix it by yourself...
pawn Код:
// same
enum Deals
{
    Name[50],
    Float:xPos,
    Float:yPos,
    Float:zPos
}
pawn Код:
// just removed the "Hauling "
stock const Jobs[][Deals] =
{
    { "Drugs", 0.00, 0.00, 0.00 },
    { "Weapons", 0.00, 0.00, 0.00 },
    { "Whores", 0.00, 0.00, 0.00 },
    { "Cars", 0.00, 0.00, 0.00 }
};
pawn Код:
// changed the last "%d" to "%s" in format because its a string
CMD:deal(playerid, params[])
{
    new pick = random(sizeof(Jobs));
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED,  "You are not in any vehicle");
    {
        SetPlayerCheckpoint(playerid, Jobs[pick][xPos], Jobs[pick][yPos], Jobs[pick][zPos], 7.0);
        new string[128], pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
        format(string, sizeof(string), "{FF0000}Player %s is now Hauling %s",pName, Jobs[pick][Name]);
        SendClientMessageToAll(playerid, string); // the first parameter is the color not the playerid, but that doesnt matter if you set a color in the text with "{}"
    }
    return 1;
}
Reply


Messages In This Thread
/deal cmd with names? - by niels44 - 03.02.2012, 13:26
Re: /deal cmd with names? - by -ExG-VirusKiller - 03.02.2012, 13:29
Re: /deal cmd with names? - by niels44 - 03.02.2012, 15:51
Re: /deal cmd with names? - by niels44 - 03.02.2012, 16:44
AW: Re: /deal cmd with names? - by Nero_3D - 03.02.2012, 17:05
Re: /deal cmd with names? - by niels44 - 03.02.2012, 17:24
Re: /deal cmd with names? - by niels44 - 03.02.2012, 18:40
Re: /deal cmd with names? - by niels44 - 04.02.2012, 13:22
AW: /deal cmd with names? - by Nero_3D - 04.02.2012, 14:27
Re: /deal cmd with names? - by niels44 - 04.02.2012, 14:43

Forum Jump:


Users browsing this thread: 1 Guest(s)