28.04.2015, 16:02
Hey Guys i have one problem with my house system.
my problem is pname.
code:
thanks.
my problem is pname.
code:
Код HTML:
if(dialogid == DIALOG_BUYHOUSE) { if(response) { new label[526],text[256]; for(new i = 0; i<MAX_HOUSES; i++) { if(IsPlayerInRangeOfPoint(playerid, 3.0, dataHouse[i][EnterX], dataHouse[i][EnterY],dataHouse[i][EnterZ])) { if(playerid < dataHouse[i][Price])return SendClientMessage(playerid,-1,"You are {FF0000}not{FFFFFF} have moneys for buy this house."); if(dataHouse[i][Owned] == 1)return SendClientMessage(playerid,-1,"This House owned from another player."); format(label,sizeof(label),"{00FF00}House ID:{FFFFFF}%d\n{00FF00}House Owner:{FFFFFF}%s\n{00FF00}House Locked: {FFFFFF}%d\n{00FF00}House Price:{FFFFFF} %d",i,dataHouse[i][Owner],dataHouse[i][Locked],dataHouse[i][Price]); DestroyDynamicMapIcon(dataHouse[i][MapIcon]); Delete3DTextLabel(dataHouse[i][hLabel]); DestroyPickup(dataHouse[i][Pick]); dataHouse[i][MapIcon] = CreateDynamicMapIcon(dataHouse[i][EnterX],dataHouse[i][EnterY],dataHouse[i][EnterZ], 32, 0, -1, -1, -1, 100.0); dataHouse[i][hLabel] = Create3DTextLabel(label, 0xFFFFFFFF, dataHouse[i][EnterX],dataHouse[i][EnterY],dataHouse[i][EnterZ], 25.0, 0, 0); dataHouse[i][Pick] = CreatePickup(1272, 1, dataHouse[i][EnterX],dataHouse[i][EnterY],dataHouse[i][EnterZ], 0); GivePlayerMoney(playerid,-dataHouse[i][Price]); dataHouse[i][Owned] = 1; new pname[24]; GetPlayerName(playerid,pname,24); dataHouse[i][Owner] = pname; SaveHouse(i); format(text,sizeof(text),"You have {00FF00}successfully{FFFFFF} buy this house (ID:{FFFF00} %d{FFFFFF} | Price:{FFFF00} %d{FFFFFF})",dataHouse[i][ID],dataHouse[i][Price]); SendClientMessage(playerid,-1,text); } } } }