DIALOGS HELP PLEASE !!! -
Rafa - 26.11.2010
hello guys i wan't to make dialog i made it but i need when player will choose some weapon of the list i want to come back the same dialog in same position not to exit..
cause when im choosing some weapons the dialog exit and i need again to tupe /dweap to show... hope u understand me xD
here is the script:
pawn Код:
if(strcmp(cmdtext, "/dweap", true) == 0)
{
ShowPlayerDialog(playerid, DIALOG_DWEAP, DIALOG_STYLE_LIST, "Doantors Packet Weapons", "\nSniper" "\nM5" "\nTec9" "\nM4" "\nSawn Off" "\nDeagle" "\nArmor", "Get", "Cancel");
return 1;
}
if(dialogid == DIALOG_DWEAP)
{
if(response)
{
switch(listitem)
{
case 0:
{
GivePlayerWeapon(playerid, 34, 5000);
SendClientMessage(playerid, RED, "You have picked Sniper.");
}
case 1:
{
GivePlayerWeapon(playerid, 29, 5000);
SendClientMessage(playerid, RED, "You have picked MP5.");
}
case 2:
{
GivePlayerWeapon(playerid, 32, 6000);
SendClientMessage(playerid, RED, "You have picked Tec9.");
}
case 3:
{
GivePlayerWeapon(playerid, 31, 5000);
SendClientMessage(playerid, RED, "You have picked M4");
return 1;
}
case 4:
{
GivePlayerWeapon(playerid, 26, 5000);
SendClientMessage(playerid, RED, "You have picked Sawn Off.");
return 1;
}
case 5:
{
GivePlayerWeapon(playerid, 24, 5000);
SendClientMessage(playerid, RED, "You have picked Deagle.");
return 1;
}
case 6:
{
SetPlayerArmour(playerid, 100.0);
SendClientMessage(playerid, RED, "You have picked Armor.");
return 1;
}
}
}
else SendClientMessage(playerid,0xff0000FF, "You have cancelled.");
}
EDIT: and please some one tell me what is the problem with this command...
pawn Код:
if(strcmp(cmdtext, "/fix", true) == 0)
{
new healt;
GetVehicleHealth(vehicleid, healt);
if(healt < 800.0)
{
SetVehicleHealth(vehicleid, 1000);
}
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, RED, "You are not in any vehicle.");
SendClientMessage(playerid, RED, "Your vehicle has been successfully repaired!");
return 1;
}
cause giving me some errors...
pawn Код:
C:\Documents and Settings\Vlado\Desktop\samp\gamemodes\Mace-Roleplay.pwn(640) : error 017: undefined symbol "vehicleid"
C:\Documents and Settings\Vlado\Desktop\samp\gamemodes\Mace-Roleplay.pwn(643) : error 017: undefined symbol "vehicleid"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Errors.
Thanks for helping.
Re: DIALOGS HELP PLEASE !!! -
randomkid88 - 26.11.2010
Can you list which weapons close the dialog? (If I had to guess it would be the M4, Sawn-Off, Deagle, and Armor).
And for your command:
pawn Код:
if(strcmp(cmdtext, "/fix", true) == 0)
{
new healt, vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
GetVehicleHealth(vehicleid, healt);
if(healt < 800.0)
{
SetVehicleHealth(vehicleid, 1000);
//RepairVehicle(vehicleid);
}
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, RED, "You are not in any vehicle.");
SendClientMessage(playerid, RED, "Your vehicle has been successfully repaired!");
return 1;
}
Also, if you want it to repair the physical damage, like the damage you can see, use RepairVehicle(vehicleid). SetVehicleHealth makes the health of the vehicle to 1000 but if its damaged on the outside it will still look damaged.
Re: DIALOGS HELP PLEASE !!! -
Mehtab - 26.11.2010
put the function in a public with vehicleid
Re: DIALOGS HELP PLEASE !!! -
randomkid88 - 26.11.2010
Quote:
Originally Posted by Mehtab
put the function in a public with vehicleid
|
That won't do him any good since its a command.
Re: DIALOGS HELP PLEASE !!! -
Rafa - 26.11.2010
warning:
pawn Код:
C:\Documents and Settings\Vlado\Desktop\samp\gamemodes\Mace-Roleplay.pwn(641) : warning 213: tag mismatch
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Warning.
and please some one help me with dialogs
Re: DIALOGS HELP PLEASE !!! -
randomkid88 - 26.11.2010
Answer the question I asked you about your dialogs so I can help you from my first post. And which line gives the error?
Re: DIALOGS HELP PLEASE !!! -
Rafa - 26.11.2010
all weapons... i tell before u ask on any weapon i choose the dialog exit i just want when player will choose weapon to dont exit the dialog when he will click Cancel than to EXIT it... Thanks
hmmm...
pawn Код:
GetVehicleHealth(vehicleid, healt); // on this line error
Thanks again xD
Re: DIALOGS HELP PLEASE !!! -
Jeffry - 26.11.2010
to:
pawn Код:
new Float:healt, vehicleid;
------------------------
EDIT: And to not close the dialog:
Try:
pawn Код:
if(dialogid == DIALOG_DWEAP)
{
if(response)
{
switch(listitem)
{
case 0:
{
GivePlayerWeapon(playerid, 34, 5000);
SendClientMessage(playerid, RED, "You have picked Sniper.");
return ShowPlayerDialog(playerid, DIALOG_DWEAP, DIALOG_STYLE_LIST, "Doantors Packet Weapons", "\nSniper" "\nM5" "\nTec9" "\nM4" "\nSawn Off" "\nDeagle" "\nArmor", "Get", "Cancel");
}
case 1:
{
GivePlayerWeapon(playerid, 29, 5000);
SendClientMessage(playerid, RED, "You have picked MP5.");
return ShowPlayerDialog(playerid, DIALOG_DWEAP, DIALOG_STYLE_LIST, "Doantors Packet Weapons", "\nSniper" "\nM5" "\nTec9" "\nM4" "\nSawn Off" "\nDeagle" "\nArmor", "Get", "Cancel");
}
case 2:
{
GivePlayerWeapon(playerid, 32, 6000);
SendClientMessage(playerid, RED, "You have picked Tec9.");
return ShowPlayerDialog(playerid, DIALOG_DWEAP, DIALOG_STYLE_LIST, "Doantors Packet Weapons", "\nSniper" "\nM5" "\nTec9" "\nM4" "\nSawn Off" "\nDeagle" "\nArmor", "Get", "Cancel");
}
case 3:
{
GivePlayerWeapon(playerid, 31, 5000);
SendClientMessage(playerid, RED, "You have picked M4");
return ShowPlayerDialog(playerid, DIALOG_DWEAP, DIALOG_STYLE_LIST, "Doantors Packet Weapons", "\nSniper" "\nM5" "\nTec9" "\nM4" "\nSawn Off" "\nDeagle" "\nArmor", "Get", "Cancel");
}
case 4:
{
GivePlayerWeapon(playerid, 26, 5000);
SendClientMessage(playerid, RED, "You have picked Sawn Off.");
return ShowPlayerDialog(playerid, DIALOG_DWEAP, DIALOG_STYLE_LIST, "Doantors Packet Weapons", "\nSniper" "\nM5" "\nTec9" "\nM4" "\nSawn Off" "\nDeagle" "\nArmor", "Get", "Cancel");
}
case 5:
{
GivePlayerWeapon(playerid, 24, 5000);
SendClientMessage(playerid, RED, "You have picked Deagle.");
return ShowPlayerDialog(playerid, DIALOG_DWEAP, DIALOG_STYLE_LIST, "Doantors Packet Weapons", "\nSniper" "\nM5" "\nTec9" "\nM4" "\nSawn Off" "\nDeagle" "\nArmor", "Get", "Cancel");
}
case 6:
{
SetPlayerArmour(playerid, 100.0);
SendClientMessage(playerid, RED, "You have picked Armor.");
return ShowPlayerDialog(playerid, DIALOG_DWEAP, DIALOG_STYLE_LIST, "Doantors Packet Weapons", "\nSniper" "\nM5" "\nTec9" "\nM4" "\nSawn Off" "\nDeagle" "\nArmor", "Get", "Cancel");
}
}
}
else SendClientMessage(playerid,0xff0000FF, "You have cancelled.");
}
Re: DIALOGS HELP PLEASE !!! -
Rafa - 26.11.2010
ohh hell i forget that xD
Re: DIALOGS HELP PLEASE !!! -
Rafa - 26.11.2010
sorry for this topic fixed by myself the dialog XD
btw thanks jeffry i just get that idea and i test it in server but with out "return" just "ShowPlayerDialog" xD