SA-MP Forums Archive
Help with one command - 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: Help with one command (/showthread.php?tid=92420)



Help with one command - mjr2006 - 19.08.2009

Hello!
I'm wanna do a command to only Donate >= 3
See that:
Quote:

if (strcmp(cmd, "/kitgold", true) == 0)
{
if(PlayerToPoint(3.0, playerid, 829.1633,-1761.8682,13.3009))
if(PlayerToPoint(3.0, playerid, 2496.2861,-1496.2053,23.7405))
{
if(PlayerInfo[playerid][pDonateRank] == 3)
{
format(string, sizeof(string), "* The player %s take he vipkit.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
GivePlayerWeapon(playerid,348,300);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
SendClientMessage(playerid, COLOR_RED, "You take you vipkit!");
return 1;
}
}
}

I Do that, but when i type the command say: Unknow Command, can someone help me?


Re: Help with one command - coole210 - 19.08.2009

Lets go through the errors

1. try

pawn Код:
if(PlayerToPoint(3.0, playerid, 829.1633,-1761.8682,13.3009))
  if(PlayerToPoint(3.0, playerid, 2496.2861,-1496.2053,23.7405) || if(PlayerToPoint(3.0, playerid, 829.1633,-1761.8682,13.3009))
2. GivePlayerWeapon(playerid,weaponid,ammo);

WTF is ID 348 ?

3. Why is the bracket under /kitgold all the way back there? Why do the brackets at the end match with return 1;?



Re: Help with one command - mjr2006 - 20.08.2009

I'm new in pawno..

The correct command is:
Quote:

if (strcmp(cmd, "/kitgold", true) == 0)
{
if(PlayerToPoint(3.0, playerid, 2496.2861,-1496.2053,23.7405) || if(PlayerToPoint(3.0, playerid, 829.1633,-1761.8682,13.3009)
{
if(PlayerInfo[playerid][pDonateRank] == 3)
{
format(string, sizeof(string), "* The player %s take he vipkit.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
GivePlayerWeapon(playerid,348,300);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
SendClientMessage(playerid, COLOR_RED, "You take you vipkit!");
return 0;
}
}
}

?


Re: Help with one command - Djiango - 20.08.2009

pawn Код:
SendClientMessage(playerid, COLOR_RED, "You take you vipkit!");
    }
  }
  return 1;
}
GivePlayerWeapon(playerid,348,300);
Weapon id is not correct.


Re: Help with one command - mjr2006 - 20.08.2009

When i will try to compile the pawno crash!
I think of be the:
if(PlayerToPoint(3.0, playerid, 2496.2861,-1496.2053,23.7405) || if(PlayerToPoint(3.0, playerid, 829.1633,-1761.8682,13.3009)


Re: Help with one command - Djiango - 20.08.2009

Try
pawn Код:
if(PlayerToPoint(3.0, playerid, 2496.2861,-1496.2053,23.7405) || if(PlayerToPoint(3.0, playerid, 829.1633,-1761.8682,13.3009)))



Re: Help with one command - mjr2006 - 20.08.2009

Quote:

C:\Documents and Settings\Gta\Meus documentos\Meus arquivos recebidos\lothusrpnovo.pwn(24437) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Gta\Meus documentos\Meus arquivos recebidos\lothusrpnovo.pwn(24437) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\Gta\Meus documentos\Meus arquivos recebidos\lothusrpnovo.pwn(24437) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Gta\Meus documentos\Meus arquivos recebidos\lothusrpnovo.pwn(24437) : fatal error 107: too many error messages on one line

Quote:

Line: 24437
if(PlayerToPoint(3.0, playerid, 2496.2861,-1496.2053,23.7405) || if(PlayerToPoint(3.0, playerid, 829.1633,-1761.8682,13.3009)))
{

24436:
GetPlayerName(playerid, sendername, sizeof(sendername));

Thank You


Re: Help with one command - Djiango - 20.08.2009

Quote:
Originally Posted by mjr2006
Quote:

C:\Documents and Settings\Gta\Meus documentos\Meus arquivos recebidos\lothusrpnovo.pwn(24437) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Gta\Meus documentos\Meus arquivos recebidos\lothusrpnovo.pwn(24437) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\Gta\Meus documentos\Meus arquivos recebidos\lothusrpnovo.pwn(24437) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Gta\Meus documentos\Meus arquivos recebidos\lothusrpnovo.pwn(24437) : fatal error 107: too many error messages on one line

Quote:

Line: 24437
if(PlayerToPoint(3.0, playerid, 2496.2861,-1496.2053,23.7405) || if(PlayerToPoint(3.0, playerid, 829.1633,-1761.8682,13.3009)))
{

24436:
GetPlayerName(playerid, sendername, sizeof(sendername));

Thank You
Well it's 3 am here, so i'm a little tired. Sorry.

@ Seif
Is it more efficient to have two returns, instead of one?


Re: Help with one command - mjr2006 - 20.08.2009

I dont get the weapons and the health and the ammo!
please help :P


Re: Help with one command - mjr2006 - 20.08.2009

BUMP