Larsey123IsMe
Unregistered
I have two problems... After i have typed "/caroptions" then i die after the dialog comes to my screen =/
and how can i change "Larsey123" to inputtext
pawn Код:
#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;
}
Larsey123IsMe
Unregistered
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 =/
Posts: 1,495
Threads: 131
Joined: Jul 2009
Reputation:
0
try TogglePlayerControllable(playerid, 0);
when executing the command
and TogglePlayerControllable(playerid, 1);
when finishing with the Dialog...
when you are freezed you can't lose health, which could help maybe...
Larsey123IsMe
Unregistered
05.01.2011, 23:14
(
Последний раз редактировалось Larsey123IsMe; 05.01.2011 в 23:45.
)
THANKS
Larsey123IsMe
Unregistered
Another question: How to respawn the car where i am...
Example:
1.) I find a car on the road
2.) Drive 1 mile or W/E
3.) Open the "/caroptions" and change numbers..
4.) The car respawn where i am. not where i found it..
but it is like this niw:
1.) I find a car on the road
2.) Drive 1 mile or W/E
3.) Open the "/caroptions" and change numbers..
4.) then the car respawn there i found it
Posts: 99
Threads: 2
Joined: Dec 2010
Use:
pawn Код:
#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;
}
Larsey123IsMe
Unregistered
That fucked my game xD... maybe my fault?
Your code had some errors/warnings.. so i edited it like this(bit it fucks my game =/):
pawn Код:
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;
}
Larsey123IsMe
Unregistered
Bump.
Is it 48 hours between evry bump? If yes, then sorry for this bump, i really need this