iif(strcmp(cmd, "/addcar", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_DBLUE, "USAGE: /addcar [Carid] [statcode] [amount]");
SendClientMessage(playerid, COLOR_GRAD4, "|1 Car Location |2 Car Owner |3 Car Color 1 |4 Car Color 2 |5 Car Model |6 Car Price ");
SendClientMessage(playerid, COLOR_GRAD4, "|7 Car Name |8 Car Level");
SendClientMessage(playerid, COLOR_GRAD3, "Car Location dosen't need any amount, Put 0");
return 1;
}
new ccid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_DBLUE, "USAGE: /addcar [Carid] [statcode] [amount]");
SendClientMessage(playerid, COLOR_GRAD4, "|1 Car Location |2 Car Owner |3 Car Color 1 |4 Car Color 2 |5 Car Model |6 Car Price ");
SendClientMessage(playerid, COLOR_GRAD4, "|7 Car Name |8 Car Level");
SendClientMessage(playerid, COLOR_GRAD3, "Car Location dosen't need any amount, Put 0");
return 1;
}
new stat;
stat = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_DBLUE, "USAGE: /addcar [Carid] [statcode] [amount]");
SendClientMessage(playerid, COLOR_GRAD4, "|1 Car Location |2 Car Owner |3 Car Color 1 |4 Car Color 2 |5 Car Model |6 Car Price ");
SendClientMessage(playerid, COLOR_GRAD4, "|7 Car Name |8 Car Level");
SendClientMessage(playerid, COLOR_GRAD3, "Car Location dosen't need any amount, Put 0");
return 1;
}
new amount;
amount = strval(tmp);
if ((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >= 1337)
{
switch (stat)
{
case 1:
{
new Float: Carx, Float: Cary, Float: Carz, Float:Carr;
GetPlayerPos(playerid, Carx, Cary, Carz);
GetPlayerFacingAngle(playerid, Carr);
CInfo[ccid][cParkx] = Carx;
CInfo[ccid][cParky] = Cary;
CInfo[ccid][cParkz] = Carz;
CInfo[ccid][cParkr] = Carr;
SendClientMessage(playerid, COLOR_GREEN, "Car Location set");
OnPropUpdate();
}
case 2:
{
CInfo[ccid][cOwner] = amount;
SendClientMessage(playerid, COLOR_GREEN, "Car Owner Set");
OnPropUpdate();
}
case 3:
{
CInfo[ccid][cCol1] = amount;
SendClientMessage(playerid, COLOR_GREEN, "Car Car 1 Set");
OnPropUpdate();
}
case 4:
{
CInfo[ccid][cCol2] = amount;
SendClientMessage(playerid, COLOR_GREEN, "Car Color 2 Set");
OnPropUpdate();
}
case 5:
{
CInfo[ccid][cMod] = amount;
SendClientMessage(playerid, COLOR_GREEN, "Car Model Set");
OnPropUpdate();
}
case 6:
{
CInfo[ccid][cValue] = amount;
SendClientMessage(playerid, COLOR_GREEN, "Car Price Set");
OnPropUpdate();
}
case 7:
{
CInfo[ccid][cName] = amount;
SendClientMessage(playerid, COLOR_GREEN, "Car Name Set");
OnPropUpdate();
}
case 8:
{
CInfo[ccid][cLevel] = amount;
SendClientMessage(playerid, COLOR_GREEN, "Car Level Set");
OnPropUpdate();
}
default:
{
SendClientMessage(playerid, COLOR_RED, "ERROR: Invalid Stat Code");
}
}
}
// SendClientMessage(playerid, COLOR_RED, "You are not authorized to use that command!");
return 1;
}
Originally Posted by bartje01
I don't know how to do this. But if I'm right you can add cars in a map editor and convert them with a convert program/site
|
if(strcmp(cmd, "/addcar", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_DBLUE, "USAGE: /addcar [Carid] [statcode] [amount]");
SendClientMessage(playerid, COLOR_GRAD4, "|1 Car Location |2 Car Owner |3 Car Color 1 |4 Car Color 2 |5 Car Model |6 Car Price ");
SendClientMessage(playerid, COLOR_GRAD4, "|7 Car Name |8 Car Level");
SendClientMessage(playerid, COLOR_GRAD3, "Car Location dosen't need any amount, Put 0");
return 1;
}
new ccid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_DBLUE, "USAGE: /addcar [Carid] [statcode] [amount]");
SendClientMessage(playerid, COLOR_GRAD4, "|1 Car Location |2 Car Owner |3 Car Color 1 |4 Car Color 2 |5 Car Model |6 Car Price ");
SendClientMessage(playerid, COLOR_GRAD4, "|7 Car Name |8 Car Level");
SendClientMessage(playerid, COLOR_GRAD3, "Car Location dosen't need any amount, Put 0");
return 1;
}
new stat;
stat = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_DBLUE, "USAGE: /addcar [Carid] [statcode] [amount]");
SendClientMessage(playerid, COLOR_GRAD4, "|1 Car Location |2 Car Owner |3 Car Color 1 |4 Car Color 2 |5 Car Model |6 Car Price ");
SendClientMessage(playerid, COLOR_GRAD4, "|7 Car Name |8 Car Level");
SendClientMessage(playerid, COLOR_GRAD3, "Car Location dosen't need any amount, Put 0");
return 1;
}
new amount;
amount = strval(tmp);
tmp = strtok(cmdtext, idx);
if ((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >= 1337)
{
switch (stat)
{
case 1:
{
new Float: Carx, Float: Cary, Float: Carz, Float:Carr;
GetPlayerPos(playerid, Carx, Cary, Carz);
GetPlayerFacingAngle(playerid, Carr);
CInfo[ccid][cParkx] = Carx;
CInfo[ccid][cParky] = Cary;
CInfo[ccid][cParkz] = Carz;
CInfo[ccid][cParkr] = Carr;
SendClientMessage(playerid, COLOR_GREEN, "Car Location set");
OnPropUpdate();
}
case 2:
{
CInfo[ccid][cOwner] = amount;
SendClientMessage(playerid, COLOR_GREEN, "Car Owner Set");
OnPropUpdate();
}
case 3:
{
CInfo[ccid][cCol1] = amount;
SendClientMessage(playerid, COLOR_GREEN, "Car Car 1 Set");
OnPropUpdate();
}
case 4:
{
CInfo[ccid][cCol2] = amount;
SendClientMessage(playerid, COLOR_GREEN, "Car Color 2 Set");
OnPropUpdate();
}
case 5:
{
CInfo[ccid][cMod] = amount;
SendClientMessage(playerid, COLOR_GREEN, "Car Model Set");
OnPropUpdate();
}
case 6:
{
CInfo[ccid][cValue] = amount;
SendClientMessage(playerid, COLOR_GREEN, "Car Price Set");
OnPropUpdate();
}
case 7:
{
CInfo[ccid][cName] = amount;
SendClientMessage(playerid, COLOR_GREEN, "Car Name Set");
OnPropUpdate();
}
case 8:
{
CInfo[ccid][cLevel] = amount;
SendClientMessage(playerid, COLOR_GREEN, "Car Level Set");
OnPropUpdate();
}
default:
{
SendClientMessage(playerid, COLOR_RED, "ERROR: Invalid Stat Code");
}
}
}
// SendClientMessage(playerid, COLOR_RED, "You are not authorized to use that command!");
return 1;
}
Originally Posted by Fj0rtizFredde
Check your saving function so it's not saving the name with a %d if it does change it to %s because %s is used for letters and %d for numbers
|