Knock system... - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Knock system... (
/showthread.php?tid=303578)
Knock system... -
lukas567 - 14.12.2011
Hey!
How to make system, that if you pick up pickup and press Yes on dialog, the person in house will hear that you are knocking?
I tryed:
Код:
if(dialogid == 37)
{
if(response)
{
ShadInfoBoxForPlayer(playerid, "You knocked at the door...");
new inter = houseDB[pickupid][setting]; //This line
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerVirtualWorld(i)==pickupid) //And this line
{
if(GetPlayerInterior(i)==houseSETTINGS[inter][interior])
{
SendClientMessage(i,GREEN,"Someone is knocking at door");
}
}
}
}
}
return 1;
}
Errors:
Код:
D:\Siuntiniai\GRP4(1)\GRP4\gamemodes\new.pwn(4536) : error 017: undefined symbol "pickupid"
D:\Siuntiniai\GRP4(1)\GRP4\gamemodes\new.pwn(4541) : error 017: undefined symbol "pickupid"
Code under OnPlayerPickUpPickup:
Код:
if(pickupid > pickups[0][namai]-1 && pickupid < pickups[1][namai]+1)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
if(!strcmp(name,houseDB[pickupid][owner_name],true))
{
SendClientMessage(playerid,COLOR,"You've came to your house!");
new inter = houseDB[pickupid][setting];
SetPlayerInterior(playerid,houseSETTINGS[inter][interior]);
SetPlayerPos(playerid,houseSETTINGS[inter][enter_pos][0],houseSETTINGS[inter][enter_pos][1],houseSETTINGS[inter][enter_pos][2]);
SetPlayerVirtualWorld(playerid,pickupid);
return 1;
}
new msg[128];
new houseid = playerDB[playerid][rid][3];
format(msg,sizeof(msg),"Owner: %s.\nNumber: %i\nKnock to the door?",houseDB[pickupid][owner_name],houseid);
ShowPlayerDialog(playerid, 37, DIALOG_STYLE_MSGBOX,"Info",msg,"Yes","No");
return 1;
}
Re: Knock system... -
§с†¶e®РµРe - 14.12.2011
Tell us the line numbers
Re: Knock system... -
lukas567 - 14.12.2011
I wrote next to the lines