SetVehicleNumberPlate (Save Help) -
bsrk - 28.12.2010
if(strcmp(cmd, "/plate", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new ID = GetPlayerVehicleID(playerid);
new cmodel = GetVehicleModel(ID);
cmodel -= 400;
if(!IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_GRAD2, "* ERROR");
return 1;
}
if(PlayerInfo[playerid][pAdmin] >= 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /plate [number/name]");
return 1;
}
else
{
SetVehicleNumberPlate(ID, tmp);
SetVehicleToRespawn(ID);
format(string,sizeof(string),"* carname: %d number/name: %s",PlayerVehicle[cmodel],tmp);
SendClientMessage(playerid, 0x00FFFFFF, string);
}
}
}
return 1;
}
Help please...
Re: SetVehicleNumberPlate (Save Help) -
bsrk - 28.12.2010
please help...
Re: SetVehicleNumberPlate (Save Help) -
Jochemd - 28.12.2010
Use DINI or Y_Ini or DUDB or WHATEVER
Re: SetVehicleNumberPlate (Save Help) -
Mr.Jvxmc - 28.12.2010
Quote:
Originally Posted by bsrk
pawn Код:
if(strcmp(cmd, "/plate", true) == 0) { if(IsPlayerConnected(playerid)) { new ID = GetPlayerVehicleID(playerid); new cmodel = GetVehicleModel(ID); cmodel -= 400; if(!IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid, COLOR_GRAD2, "* ERROR"); return 1; } if(PlayerInfo[playerid][pAdmin] >= 1) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /plate [number/name]"); return 1; } else { SetVehicleNumberPlate(ID, tmp); SetVehicleToRespawn(ID); format(string,sizeof(string),"* carname: %d number/name: %s",PlayerVehicle[cmodel],tmp); SendClientMessage(playerid, 0x00FFFFFF, string); } } } return 1; }
Help please...
|
Show errors !
Re: SetVehicleNumberPlate (Save Help) -
bsrk - 28.12.2010
Quote:
Originally Posted by Jochemd
Use DINI or Y_Ini or DUDB or WHATEVER
|
How do DINI or Y_Ini or DUDB ?
Re: SetVehicleNumberPlate (Save Help) -
Jochemd - 28.12.2010
dini_Set, dini_Intset, etc.
Re: SetVehicleNumberPlate (Save Help) -
bsrk - 28.12.2010
Quote:
Originally Posted by Jochemd
dini_Set, dini_Intset, etc.
|
Do you have examples?
Help post example
Re: SetVehicleNumberPlate (Save Help) -
_rAped - 28.12.2010
The command should work. What do you want to do? Save it to a file so it will automaticly respawn with that plate number?
pawn Код:
// plate
if(strcmp(cmd, "/plate", true) == 0)
{
if(!IsPlayerConnected(playerid)){return 0;}
if(PlayerInfo[playerid][pAdmin] < 1){return 0;}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /plate [number/name]");
return 1;
}
else if(strlen(tmp) > 32)
{
SendClientMessage(playerid, COLOR_GRAD1, "ERROR: Plate text can't be longer then 32 characters (including colors).");
return 1;
}
else
{
new Float:vx, Float:vy, Float:vz;
new tempveh = GetPlayerVehicleID(playerid);
GetVehiclePos(tempveh, vx, vy, vz);
SetVehicleNumberPlate(tempveh, tmp);
SetVehicleToRespawn(tempveh);
SetVehiclePos(tempveh, vx, vy, vz);
PutPlayerInVehicle(playerid, tempveh, 0);
}
return 1;
}