What's wrong with this ? -
ServerScripter - 22.02.2012
hi , i've maked a vip shop with Dialogs :
pawn Код:
if(dialogid == 99)
{
if(response == 1)
{
switch(listitem)
{
case 0:
{
if(GetPlayerMoney(playerid) < 3000) {
}else{
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,100);
}
}
case 1:
{
if(GetPlayerMoney(playerid) < 2500) {
}else{
SetPlayerAttachedObject(playerid, 5, 0, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0);
}
}
case 2:
{
if(GetPlayerMoney(playerid) < 6500) {
}else{
GivePlayerWeapon(playerid,38,130);
}
}
}
}
}
whene i choose the first item(Armour+health it gives me it)
the third item works also (the Minigun case 2)
the case 1 doesn't work(the attached object) whene i choose it on the menu , it crashes me , how to fix it ? thanks.
Re: What's wrong with this ? -
Jagofr - 22.02.2012
What errors do you get, Cuz It looks like to me that you have some loose indentations.
Re: What's wrong with this ? -
ServerScripter - 22.02.2012
the error is whene i choose the item 2 (case 1 ) it crash me from the server...
Re: What's wrong with this ? -
Jagofr - 22.02.2012
Look over
SetPlayerAttachedObject <-- CLick me
Re: What's wrong with this ? -
TheDominator - 22.02.2012
Compile the script and post the errors that it gives so we can help you.
Re: What's wrong with this ? -
ServerScripter - 22.02.2012
i don't get any errors
@Jagofr ok i will check now
Re: What's wrong with this ? -
Jagofr - 22.02.2012
He used SetPlayerAttachedObject wrong...
Re: What's wrong with this ? -
ServerScripter - 22.02.2012
Quote:
Originally Posted by Jagofr
He used SetPlayerAttachedObject wrong...
|
so i use AttachObjectToPlayer ?
Re: What's wrong with this ? -
Jagofr - 22.02.2012
EDIT:
Example Code:
pawn Код:
case 1:
{
if(GetPlayerMoney(playerid) < 2500) {
}else{
SetPlayerAttachedObject(playerid, 0, 18642, 5); //Gives player a non-usable taser
}
}
See how its used?
Re: What's wrong with this ? -
Jagofr - 22.02.2012
I hope that helped: If it did give me a +rep.