What's wrong with this ?
#1

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.
Reply
#2

What errors do you get, Cuz It looks like to me that you have some loose indentations.
Reply
#3

the error is whene i choose the item 2 (case 1 ) it crash me from the server...
Reply
#4

Look over SetPlayerAttachedObject <-- CLick me
Reply
#5

Compile the script and post the errors that it gives so we can help you.
Reply
#6

i don't get any errors
@Jagofr ok i will check now
Reply
#7

He used SetPlayerAttachedObject wrong...
Reply
#8

Quote:
Originally Posted by Jagofr
Посмотреть сообщение
He used SetPlayerAttachedObject wrong...
so i use AttachObjectToPlayer ?
Reply
#9

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?
Reply
#10

I hope that helped: If it did give me a +rep.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)