BuySkin (id) - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: BuySkin (id) (
/showthread.php?tid=154919)
BuySkin (id) -
[ES]Leszek_ - 16.06.2010
Hello everybody,
i search a script for /Buyskin (id)
When i tip /Buyskin (id) then i become a skin for me.... for my nick name in dini
how to do it?
Re: BuySkin (id) -
NiiRV4N4 - 16.06.2010
pawn Код:
if(strcmp(cmd, "/buyclothes", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "[Usage:] /buyclothes [skinid]");
return 1;
}
new id = strval(tmp);
for(new i = 0; i < sizeof(Businesses); i++)
{
if (PlayerToPoint(25.0,playerid,Businesses[i][ExitX], Businesses[i][ExitY], Businesses[i][ExitZ]))
{
if(GetPlayerVirtualWorld(playerid) == i)
{
if(Businesses[i][BizType] == 6)
{
if(Businesses[i][Products] != 0)
{
if(GetPlayerCash(playerid) >= 100)
{
if(IsACopSkin(id) == 0)
{
if(IsAGovSkin(id) == 0)
{
if(IsANewsSkin(id) == 0)
{
if(IsAMafiaSkin(id) == 0)
{
if(IsATransportSkin(id) == 0)
{
if(IsABallaSkin(id) == 0)
{
if(IsAGroveSkin(id) == 0)
{
if(IsAAztecaSkin(id) == 0)
{
if(IsABikerSkin(id) == 0)
{
if(IsATriadSkin(id) == 0)
{
if(IsValidSkin(id))
{
SetPlayerSkin(playerid,id);
PlayerInfo[playerid][pSkin] = GetPlayerSkin(playerid);
GivePlayerCash(playerid,-100);
Businesses[i][Products]--;
Businesses[i][Till]+=100;
SendClientMessage(playerid, COLOR_WHITE, "[Info:] Clothes purchased, $-100");
SaveBusinesses();
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE,"[Tailor:] We don't have that here!");
//GivePlayerCash(playerid,100);
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
return 1;
Remove all of my variables, checkings, whatever they're called, basically, just check if he is in a certain spot using PlayerToPoint or that other new 0.3a function, IsPlayerInRangeofPoint. If you can't do this, you shouldn't be running a server, if you are.
Re: BuySkin (id) -
ihatetn931 - 16.06.2010
Quote:
Originally Posted by NiiRV4N4
pawn Код:
if(strcmp(cmd, "/buyclothes", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "[Usage:] /buyclothes [skinid]"); return 1; } new id = strval(tmp); for(new i = 0; i < sizeof(Businesses); i++) { if (PlayerToPoint(25.0,playerid,Businesses[i][ExitX], Businesses[i][ExitY], Businesses[i][ExitZ])) { if(GetPlayerVirtualWorld(playerid) == i) { if(Businesses[i][BizType] == 6) { if(Businesses[i][Products] != 0) { if(GetPlayerCash(playerid) >= 100) { if(IsACopSkin(id) == 0) { if(IsAGovSkin(id) == 0) { if(IsANewsSkin(id) == 0) { if(IsAMafiaSkin(id) == 0) { if(IsATransportSkin(id) == 0) { if(IsABallaSkin(id) == 0) { if(IsAGroveSkin(id) == 0) { if(IsAAztecaSkin(id) == 0) { if(IsABikerSkin(id) == 0) { if(IsATriadSkin(id) == 0) { if(IsValidSkin(id)) { SetPlayerSkin(playerid,id); PlayerInfo[playerid][pSkin] = GetPlayerSkin(playerid); GivePlayerCash(playerid,-100); Businesses[i][Products]--; Businesses[i][Till]+=100; SendClientMessage(playerid, COLOR_WHITE, "[Info:] Clothes purchased, $-100"); SaveBusinesses(); return 1; } else { SendClientMessage(playerid, COLOR_WHITE,"[Tailor:] We don't have that here!"); //GivePlayerCash(playerid,100); } } } } } } } } } } } } } } } } } } return 1;
Remove all of my variables, checkings, whatever they're called, basically, just check if he is in a certain spot using PlayerToPoint or that other new 0.3a function, IsPlayerInRangeofPoint. If you can't do this, you shouldn't be running a server, if you are.
|
you fail at indenting, if he does that he will basically have no code left
Re: BuySkin (id) -
NiiRV4N4 - 16.06.2010
Quote:
Originally Posted by [SL~RP
ihatetn931 ]
Quote:
Originally Posted by NiiRV4N4
pawn Код:
if(strcmp(cmd, "/buyclothes", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "[Usage:] /buyclothes [skinid]"); return 1; } new id = strval(tmp); for(new i = 0; i < sizeof(Businesses); i++) { if (PlayerToPoint(25.0,playerid,Businesses[i][ExitX], Businesses[i][ExitY], Businesses[i][ExitZ])) { if(GetPlayerVirtualWorld(playerid) == i) { if(Businesses[i][BizType] == 6) { if(Businesses[i][Products] != 0) { if(GetPlayerCash(playerid) >= 100) { if(IsACopSkin(id) == 0) { if(IsAGovSkin(id) == 0) { if(IsANewsSkin(id) == 0) { if(IsAMafiaSkin(id) == 0) { if(IsATransportSkin(id) == 0) { if(IsABallaSkin(id) == 0) { if(IsAGroveSkin(id) == 0) { if(IsAAztecaSkin(id) == 0) { if(IsABikerSkin(id) == 0) { if(IsATriadSkin(id) == 0) { if(IsValidSkin(id)) { SetPlayerSkin(playerid,id); PlayerInfo[playerid][pSkin] = GetPlayerSkin(playerid); GivePlayerCash(playerid,-100); Businesses[i][Products]--; Businesses[i][Till]+=100; SendClientMessage(playerid, COLOR_WHITE, "[Info:] Clothes purchased, $-100"); SaveBusinesses(); return 1; } else { SendClientMessage(playerid, COLOR_WHITE,"[Tailor:] We don't have that here!"); //GivePlayerCash(playerid,100); } } } } } } } } } } } } } } } } } } return 1;
Remove all of my variables, checkings, whatever they're called, basically, just check if he is in a certain spot using PlayerToPoint or that other new 0.3a function, IsPlayerInRangeofPoint. If you can't do this, you shouldn't be running a server, if you are.
|
you fail at indenting, if he does that he will basically have no code left
|
/buyclothes [id] is the code he'll have left. kids are so retarded now a days. why don't they understand that when you post something that came from a big text box into a small textbox that it would mess up the indention.
Re: BuySkin (id) -
ihatetn931 - 16.06.2010
Quote:
Originally Posted by NiiRV4N4
Quote:
Originally Posted by [SL~RP
ihatetn931 ]
Quote:
Originally Posted by NiiRV4N4
pawn Код:
if(strcmp(cmd, "/buyclothes", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "[Usage:] /buyclothes [skinid]"); return 1; } new id = strval(tmp); for(new i = 0; i < sizeof(Businesses); i++) { if (PlayerToPoint(25.0,playerid,Businesses[i][ExitX], Businesses[i][ExitY], Businesses[i][ExitZ])) { if(GetPlayerVirtualWorld(playerid) == i) { if(Businesses[i][BizType] == 6) { if(Businesses[i][Products] != 0) { if(GetPlayerCash(playerid) >= 100) { if(IsACopSkin(id) == 0) { if(IsAGovSkin(id) == 0) { if(IsANewsSkin(id) == 0) { if(IsAMafiaSkin(id) == 0) { if(IsATransportSkin(id) == 0) { if(IsABallaSkin(id) == 0) { if(IsAGroveSkin(id) == 0) { if(IsAAztecaSkin(id) == 0) { if(IsABikerSkin(id) == 0) { if(IsATriadSkin(id) == 0) { if(IsValidSkin(id)) { SetPlayerSkin(playerid,id); PlayerInfo[playerid][pSkin] = GetPlayerSkin(playerid); GivePlayerCash(playerid,-100); Businesses[i][Products]--; Businesses[i][Till]+=100; SendClientMessage(playerid, COLOR_WHITE, "[Info:] Clothes purchased, $-100"); SaveBusinesses(); return 1; } else { SendClientMessage(playerid, COLOR_WHITE,"[Tailor:] We don't have that here!"); //GivePlayerCash(playerid,100); } } } } } } } } } } } } } } } } } } return 1;
Remove all of my variables, checkings, whatever they're called, basically, just check if he is in a certain spot using PlayerToPoint or that other new 0.3a function, IsPlayerInRangeofPoint. If you can't do this, you shouldn't be running a server, if you are.
|
Lol kid? Umm ok. Ya if you quote it you can see the tru indenting, even if you copy and paste it
you fail at indenting, if he does that he will basically have no code left
|
/buyclothes [id] is the code he'll have left. kids are so retarded now a days. why don't they understand that when you post something that came from a big text box into a small textbox that it would mess up the indention.
|