Jump to content

Problema Checkpoint


Buckzor
 Share

Recommended Posts

  • Username: Buckzor
  • Problemă Ã®ntâlnită: Imi dispare checkpoint-ul.
  • Detalii despre problemă: Salut am o problema cu un job..

    Eu am incercat sa fac ca atunci cand ai un obiect anume in mana sa poti intra in checkpoint si sa te trimita la urmatorul si tot asa..

    iar daca nu ai acel obiect in mana sa iti spuna ca nu ai acel obiect dar sa nu dispara checkpointul

  • Ce ai încercat să faci înainte să postezi?: 
    if(GetPVarInt(playerid, "InHand") == 0) SendClientMessage(playerid, -1, "{008080}(Job):{FFFFFF} Nu ai niciun ziar in mana!");
    if(CpZiar[playerid] == 1 && GetPVarInt(playerid,"InHand") == 1)
    {
    
    }
    si alte prostii..
    
  • Cod sursă (recomandat pastebin.com): 
    	if(CpZiar[playerid] == 1 && GetPVarInt(playerid,"InHand") == 1)	
    	{
    		new rand, money, exp, string[256];
    			
    		money = 15000 + random(5000);
    		exp = 3 + random(3);
    
    		PlayerInfo[playerid][pMoney] += money;
    		GivePlayerMoneyEx(playerid, money);
    		PlayerInfo[playerid][pExp] += exp;
    
    		MoneyEarned[playerid] += money;
    		PlayerInfo[playerid][pMoney] += money;
    
    		UpdateVariable(playerid, pMoneyx);
    		UpdateVariable(playerid, pExpx);
    
    		format(string, sizeof(string), "(Job): {ffffff}Ai primit %d puncte de experienta.", exp);
    		SendClientMessage(playerid, 0x00e1edFF, string);
    
    		rand = random(sizeof(RandomZiar));
    		SetPlayerCheckpoint(playerid, RandomZiar[rand][0], RandomZiar[rand][1], RandomZiar[rand][2], 2.0);
    
    		format(string, sizeof(string), "Informatii Job~n~~n~Ai castigat: $%s~n~Castig Total: $%s", FormatNumber(money), FormatNumber(MoneyEarned[playerid]));
    		PlayerTextDrawSetString(playerid, JobTD[6], string);
    		PlayerTextDrawShow(playerid, JobTD[6]);
    
    		SetPVarInt(playerid, "InHand", 0);
    		SetPlayerSpecialAction(playerid, 0);
    		RemovePlayerAttachedObject(playerid, 6);
    		ClearAnimations(playerid);
    	}
    	else if(GetPVarInt(playerid, "InHand") == 0) SendClientMessage(playerid, -1, "{008080}(Job):{FFFFFF} Nu ai niciun ziar in mana!");
  • Alte detalii: Sunt inca incepator si nu prea ma pricep..
Edited by Buckzor
Link to comment
Share on other sites

if(GetPVarInt(playerid, "InHand") == 0) return SendClientMessage(playerid, -1, "{008080}(Job):{FFFFFF} Nu ai niciun ziar in mana!");

 

nu m am uitat prin tot codul s ar putea sa mai ai probleme, incearca asa si vezi daca merge

Link to comment
Share on other sites

  • Administrator

Aici

else if(GetPVarInt(playerid, "InHand") == 0) SendClientMessage(playerid, -1, "{008080}(Job):{FFFFFF} Nu ai niciun ziar in mana!");

Doar trimeti un amarat de mesaj, fara sa returnezi ceva.

 

Incearca sa pui:

else if(GetPVarInt(playerid, "InHand") == 0) {
    SendClientMessage(playerid, -1, "{008080}(Job):{FFFFFF} Nu ai niciun ziar in mana!");
    return 1;
}

sau direct:

else if(GetPVarInt(playerid, "InHand") == 0) return SendClientMessage(playerid, -1, "{008080}(Job):{FFFFFF} Nu ai niciun ziar in mana!");
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...