How to do this - 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: How to do this (
/showthread.php?tid=340889)
How to do this -
Scripter12345 - 08.05.2012
I have a house system where you can sell a house to another player but how could i make it so if someone has not offered them a house and they do /accepthouse it says some thing like " You are not being offered a house "
pawn Код:
CMD:sellhouse(playerid,params[])
{
new Target;
new Amount;
if(sscanf(params, "ui", Target, Amount)) return SendClientMessage(playerid, COLOR_GREEN, "/sellhouse [ID] [Amount]");
if(!IsPlayerConnected(Target))
return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected");
if(HInfo[playerid][Owned] == 0) return SendClientMessage(playerid, COLOR_RED, "You do not own a house");
new tname[MAX_PLAYER_NAME];
GetPlayerName(Target,tname,sizeof(tname));
GetPlayerName(playerid,pname,sizeof(pname));
new pstring[256];
new tstring[256];
format(pstring,sizeof(pstring),"You have offered to sell your house to %s for %d",tname, Amount);
format(tstring,sizeof(tstring),"You have been offered to buy %s's house for %d",pname, Amount);
SendClientMessage(Target, COLOR_GREEN, tstring);
SendClientMessage(playerid, COLOR_GREEN, pstring);
return 1;
}
Thank You
Please Help Me Please
Re: How to do this -
Scripter12345 - 08.05.2012
Thank You
Please Help Me Please
Respuesta: How to do this -
Chris1337 - 09.05.2012
maybe this
pawn Код:
new offered;
CMD:sellhouse(playerid,params[])
{
new Target;
new Amount;
if(sscanf(params, "ui", Target, Amount)) return SendClientMessage(playerid, COLOR_GREEN, "/sellhouse [ID] [Amount]");
if(!IsPlayerConnected(Target))
return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected");
if(HInfo[playerid][Owned] == 0) return SendClientMessage(playerid, COLOR_RED, "You do not own a house");
new tname[MAX_PLAYER_NAME];
GetPlayerName(Target,tname,sizeof(tname));
GetPlayerName(playerid,pname,sizeof(pname));
new pstring[256];
new tstring[256];
format(pstring,sizeof(pstring),"You have offered to sell your house to %s for %d",tname, Amount);
format(tstring,sizeof(tstring),"You have been offered to buy %s's house for %d",pname, Amount);
SendClientMessage(Target, COLOR_GREEN, tstring);
SendClientMessage(playerid, COLOR_GREEN, pstring);
offered = 1;
return 1;
}
CMD:accepthouse(playerid,params[])
{
if(offered ==1)
{
///YOUR CODE HERE
}
else return SendClientMessage(playerid, YOURCOLOR,"You are Not being offered a house"
}
Tell me if work
Re: How to do this -
kaisersouse - 09.05.2012
https://sampforum.blast.hk/showthread.php?tid=340873
I'm asking for mod powers back...