#include <a_samp>
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/caroptions", true))
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFF0000FF,"You must be in a vehicle.");
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Car Options", "License Plate", "Select", "Cancel");
return 1;
}
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
if(response)
{
if(listitem == 0) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Linence Plate", "Enter your license nuber (MAX: 32 characters)", "Update", "Cancel");
}
}
else if(dialogid == 2)
{
if(response)
{
for(new v = 0; v < MAX_PLAYERS; v ++)
{
SetVehicleNumberPlate(v, "Larey123");
SetVehicleToRespawn(v);
}
return 1;
}
}
return 0;
}
#include <a_samp>
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/caroptions", true))
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFF0000FF,"You must be in a vehicle.");
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Car Options", "License Plate", "Select", "Cancel");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
if(response)
{
if(listitem == 0) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Linence Plate", "Enter your license nuber (MAX: 32 characters)", "Update", "Cancel");
}
}
else if(dialogid == 2)
{
if(response)
{
for(new v = 0; v < MAX_PLAYERS; v ++)
{
SetVehicleNumberPlate(v,inputtext);
SetVehicleToRespawn(v);
}
return 1;
}
}
return 0;
}
Thanks... but why is he dying?
1: /caroptions 2: Dialog "Car Options" comes up 3: Click on "License Plate" 4: Enter My License number 5: Then i click "Update" 6: Then i die =/ |
#include <a_samp>
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/caroptions", true))
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFF0000FF,"You must be in a vehicle.");
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Car Options", "License Plate", "Select", "Cancel");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
if(response)
{
if(listitem == 0) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Linence Plate", "Enter your license nuber (MAX: 32 characters)", "Update", "Cancel");
}
}
else if(dialogid == 2)
{
if(response)
{
for(new v = 0; v < MAX_PLAYERS; v ++)
{
New Float:X, Float:y, Float:z, Floatt:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Angle);
SetVehicleNumberPlate(v,inputtext);
SetVehicleToRespawn(v);
SetVehiclePos(v, X, Y, Z);
SetVehicleZAngle(v, A);
PutPlayerInVehicle(playerid, v, 0)
}
return 1;
}
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
if(response)
{
if(listitem == 0) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Linence Plate", "Enter your license nuber (MAX: 32 characters)", "Update", "Cancel");
}
}
else if(dialogid == 2)
{
if(response)
{
for(new v = 0; v < MAX_PLAYERS; v ++)
{
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
SetVehicleNumberPlate(v,inputtext);
SetVehicleToRespawn(v);
SetVehiclePos(v, X, Y, Z);
SetVehicleZAngle(v, A);
PutPlayerInVehicle(playerid, v, 0);
}
return 1;
}
}
return 0;
}