enum Deals
{
Name[50],
Float:xPos,
Float:yPos,
Float:zPos
}
new Jobs[][Deals] =
{
{ "Hauling Drugs", 0.00, 0.00, 0.00 },
{ "Hauling Weapons", 0.00, 0.00, 0.00 },
{ "Hauling Whores", 0.00, 0.00, 0.00 },
{ "Hauling Cars", 0.00, 0.00, 0.00 }
};
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], Dealname[Deals], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "Player %s is now Hauling %d",pName, Dealname);
SendClientMessageToAll(playerid, string);
}
return 1;
}
format(string, sizeof(string), "Player %s is now Hauling %d",pName, Dealname);
enum Deals
{
Name[50],
Float:xPos,
Float:yPos,
Float:zPos
}
new string[128], Dealname[Deals], pName[MAX_PLAYER_NAME];
In the Line
pawn Код:
|
enum Deals // 53 - just do "printf("Deals: %d", _: Deals);" to prove it
{
Name[50], // 0 - 49
Float:xPos, // 50
Float:yPos, // 51
Float:zPos // 52
}
new Dealname[Deals];
stock const Jobs[][Deals] =
{
{ "Hauling Drugs", 0.00, 0.00, 0.00 },
{ "Hauling Weapons", 0.00, 0.00, 0.00 },
{ "Hauling Whores", 0.00, 0.00, 0.00 },
{ "Hauling Cars", 0.00, 0.00, 0.00 }
};
enum Deals
{
Name[50],
Float:xPos,
Float:yPos,
Float:zPos
}
stock const Jobs[][Deals] =
{
{ "Hauling Drugs", 0.00, 0.00, 0.00 },
{ "Hauling Weapons", 0.00, 0.00, 0.00 },
{ "Hauling Whores", 0.00, 0.00, 0.00 },
{ "Hauling Cars", 0.00, 0.00, 0.00 }
};
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 %d",pName, Jobs[pick][Name]);
SendClientMessageToAll(playerid, string);
}
return 1;
}
// same
enum Deals
{
Name[50],
Float:xPos,
Float:yPos,
Float:zPos
}
// 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 }
};
// 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;
}