Help with one command
#1

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?
Reply
#2

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;?
Reply
#3

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;
}
}
}

?
Reply
#4

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

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)
Reply
#6

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

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
Reply
#8

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?
Reply
#9

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

BUMP
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)