number of arguments does not match definition
#1

if(strcmp("/drunk", cmdtext, true, 9) == 0)
{
SetPlayerDrunkLevel(playerid, GetPlayerDrunkLevel(playerid) + 2000);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRI NK_BEER);
ApplyAnimation(playerid,"PED","WALK_DRUNK",4.1,1,1 ,1,1,1);
GameTextForPlayer(playerid,"~W~Drunk Mode Is ~g~On!",3000,5);
SendClientMessage(playerid, 0xFF641AFF, "SERVER: Type /drunk off to Stop being Drunk.");
SetPlayerHealth(playerid, GetPlayerHealth(playerid) + 20);
return 1;
}

can someone fix it for me ?

edit : the error showed when i added setplayerhealth; whats wrong with it ?
Reply
#2

https://sampwiki.blast.hk/wiki/GetPlayerHealth

Two parameters, you used one:
'GetPlayerHealth(playerid)'

Make it like this:

pawn Код:
if(strcmp("/drunk", cmdtext, true, 9) == 0)
  {
   new pHealth;
   GetPlayerHealth(playerid, pHealth);
   SetPlayerDrunkLevel(playerid, GetPlayerDrunkLevel(playerid) + 2000);
   SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_BEER);
   ApplyAnimation(playerid,"PED","WALK_DRUNK",4.1,1,1,1,1,1);
   GameTextForPlayer(playerid,"~W~Drunk Mode Is ~g~On!",3000,5);
   SendClientMessage(playerid, 0xFF641AFF, "SERVER: Type /drunk off to Stop being Drunk.");
   SetPlayerHealth(playerid, pHealth =+ 20);
    return 1;
  }
Reply
#3

Quote:
Originally Posted by VonLeeuwen
https://sampwiki.blast.hk/wiki/GetPlayerHealth

Two parameters, you used one:
'GetPlayerHealth(playerid)'

Make it like this:

pawn Код:
if(strcmp("/drunk", cmdtext, true, 9) == 0)
  {
   new pHealth;
   GetPlayerHealth(playerid, pHealth);
   SetPlayerDrunkLevel(playerid, GetPlayerDrunkLevel(playerid) + 2000);
   SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_BEER);
   ApplyAnimation(playerid,"PED","WALK_DRUNK",4.1,1,1,1,1,1);
   GameTextForPlayer(playerid,"~W~Drunk Mode Is ~g~On!",3000,5);
   SendClientMessage(playerid, 0xFF641AFF, "SERVER: Type /drunk off to Stop being Drunk.");
   SetPlayerHealth(playerid, pHealth =+ 20);
    return 1;
  }
C:\Users\Max\Documents\Server\gamemodes\lvgangwar. pwn(1082) : warning 213: tag mismatch
C:\Users\Max\Documents\Server\gamemodes\lvgangwar. pwn(108 : error 029: invalid expression, assumed zero
C:\Users\Max\Documents\Server\gamemodes\lvgangwar. pwn(108 : warning 215: expression has no effect
C:\Users\Max\Documents\Server\gamemodes\lvgangwar. pwn(108 : error 001: expected token: ";", but found ")"
C:\Users\Max\Documents\Server\gamemodes\lvgangwar. pwn(108 : error 029: invalid expression, assumed zero
C:\Users\Max\Documents\Server\gamemodes\lvgangwar. pwn(108 : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#4

no body knows? everyone is lazy? bump
Reply
#5

Quote:
Originally Posted by jamesbond007
no body knows? everyone is lazy? bump
How about you stop being "lazy" and look on the Wiki.
Reply
#6

Quote:
Originally Posted by Donny
Quote:
Originally Posted by jamesbond007
no body knows? everyone is lazy? bump
How about you stop being "lazy" and look on the Wiki.
wiki doesnt say much about this...
Reply
#7

It has an example on the page, what more do you want ?

Compare the variables and function usage with yours, you should see the difference.
Reply
#8

i dont want it like its on wiki whati m trying to do is when a person types /drunk and clicks the left mouse button to drink so his health goes up by around 30 percent i dont know whats your problem dude. i have errors on both lines wtf is tag mismatch its suppose to be working why doesnt it
Reply
#9

Код:
if(strcmp("/drunk", cmdtext, true, 9) == 0)
  {
   new Float:pHealth; // You had to define this as a float - That was the tag mismatch error
   GetPlayerHealth(playerid, pHealth);
   SetPlayerDrunkLevel(playerid, GetPlayerDrunkLevel(playerid) + 2000);
   SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_BEER);
   ApplyAnimation(playerid,"PED","WALK_DRUNK",4.1,1,1,1,1,1);
   GameTextForPlayer(playerid,"~W~Drunk Mode Is ~g~On!",3000,5);
   SendClientMessage(playerid, 0xFF641AFF, "SERVER: Type /drunk off to Stop being Drunk.");
   SetPlayerHealth(playerid, pHealth + 20); // not sure what the =+ was for but this works fine
   return 1;
  }
   return 0; // Has to move this over a space due to loose indentation warning
}
Reply
#10

Quote:
Originally Posted by jamesbond007
i dont want it like its on wiki whati m trying to do is when a person types /drunk and clicks the left mouse button to drink so his health goes up by around 30 percent i dont know whats your problem dude. i have errors on both lines wtf is tag mismatch its suppose to be working why doesnt it
You missed my point, you call people lazy but you are too lazy to open the manual and do a little research into what "tag mismatch" means. You shoud of like I said compared the variables in your code to the code on the Wiki, the Wiki one has a "Float:" tag and your doesn't hence the mismatch.

Also I have no problem dude, it's all good but put a little more effort in before you start calling people lazy and breaking rules (bumping before twelve hours has passed).
Reply
#11

Quote:
Originally Posted by MisterTickle
Код:
if(strcmp("/drunk", cmdtext, true, 9) == 0)
  {
   new Float:pHealth; // You had to define this as a float - That was the tag mismatch error
   GetPlayerHealth(playerid, pHealth);
   SetPlayerDrunkLevel(playerid, GetPlayerDrunkLevel(playerid) + 2000);
   SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_BEER);
   ApplyAnimation(playerid,"PED","WALK_DRUNK",4.1,1,1,1,1,1);
   GameTextForPlayer(playerid,"~W~Drunk Mode Is ~g~On!",3000,5);
   SendClientMessage(playerid, 0xFF641AFF, "SERVER: Type /drunk off to Stop being Drunk.");
   SetPlayerHealth(playerid, pHealth + 20); // not sure what the =+ was for but this works fine
   return 1;
  }
   return 0; // Has to move this over a space due to loose indentation warning
}
thanks just what with the two return?
Reply
#12

From my understanding Return 0; is always at the end of onplayercommandtext, Return 1; will close off each of your commands so it doesn't do some clusterfuck and keeps them seperate - In non complicated scripting terms.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)