SA-MP Forums Archive
How do i get rid of these warnings?!? - 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 do i get rid of these warnings?!? (/showthread.php?tid=168793)



How do i get rid of these warnings?!? - Chrillzen - 17.08.2010

Hi i'm trying to make a FS, but i keep getting these Warnings, how can i get rid of them?

Код:
C:\Users\Chrillzen\Desktop\Allt\SAMP\filterscripts\S-Cheats.pwn(143) : warning 202: number of arguments does not match definition
C:\Users\Chrillzen\Desktop\Allt\SAMP\filterscripts\S-Cheats.pwn(143) : warning 202: number of arguments does not match definition
C:\Users\Chrillzen\Desktop\Allt\SAMP\filterscripts\S-Cheats.pwn(158) : warning 202: number of arguments does not match definition
C:\Users\Chrillzen\Desktop\Allt\SAMP\filterscripts\S-Cheats.pwn(158) : warning 202: number of arguments does not match definition
C:\Users\Chrillzen\Desktop\Allt\SAMP\filterscripts\S-Cheats.pwn(173) : warning 202: number of arguments does not match definition
C:\Users\Chrillzen\Desktop\Allt\SAMP\filterscripts\S-Cheats.pwn(173) : warning 202: number of arguments does not match definition
C:\Users\Chrillzen\Desktop\Allt\SAMP\filterscripts\S-Cheats.pwn(187) : warning 202: number of arguments does not match definition
C:\Users\Chrillzen\Desktop\Allt\SAMP\filterscripts\S-Cheats.pwn(187) : warning 202: number of arguments does not match definition
C:\Users\Chrillzen\Desktop\Allt\SAMP\filterscripts\S-Cheats.pwn(194) : warning 202: number of arguments does not match definition
C:\Users\Chrillzen\Desktop\Allt\SAMP\filterscripts\S-Cheats.pwn(194) : warning 202: number of arguments does not match definition
C:\Users\Chrillzen\Desktop\Allt\SAMP\filterscripts\S-Cheats.pwn(201) : warning 202: number of arguments does not match definition
C:\Users\Chrillzen\Desktop\Allt\SAMP\filterscripts\S-Cheats.pwn(201) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


12 Warnings.
This is from one warning.

Код:
     format(string, sizeof(string), "%s, you recieved armor, health and money.", GetPlayerName(playerid));
     SendClientMessage(playerid, COLOR_GREEN, string);



Re: How do i get rid of these warnings?!? - ikey07 - 17.08.2010

new name[MAX_PLAYER_NAME];

GetPlayerName(playerid,name,sizeof(name));

format(string, sizeof(string), "%s, you recieved armor, health and money.",name);
SendClientMessage(playerid, COLOR_GREEN, string);


Re: How do i get rid of these warnings?!? - Chrillzen - 17.08.2010

Ohh thanks!
XD

EDIT: It does not get the playername, it just sais ,you recived..


Re: How do i get rid of these warnings?!? - ikey07 - 17.08.2010

mhmh, strange


Re: How do i get rid of these warnings?!? - Claude - 17.08.2010

pawn Код:
stock GetPlayerName(playerid)
{
    new name[20]; // max player name allowed
    GetPlayerName(playerid, name, 20);
    return name;
}
If you use "GetPlayerName"


Re: How do i get rid of these warnings?!? - Mike Garber - 17.08.2010

Quote:
Originally Posted by Claude
Посмотреть сообщение
pawn Код:
stock GetPlayerName(playerid)
{
    new name[20]; // max player name allowed
    GetPlayerName(playerid, name, 20);
    return name;
}
If you use "GetPlayerName"
Thought GetPlayerName is already defined by default,

Anyways, here's an example of usage;

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


Re: How do i get rid of these warnings?!? - bestr32 - 18.01.2012

pawn Код:
new pname[MAX_PLAYER_NAME]; //Defining pname as player's in-game name.
new string[156]; // Defining the string
GetPlayerName(playerid, pname, sizeof(pname)); // Using pname as getting player's name
format(string,sizeof(string), "%s, you received armor, health and money", pname); // Formating the string
SendClientMessage(playerid, COLOUR, string);



Re: How do i get rid of these warnings?!? - milanosie - 18.01.2012

Код:
     
     new string[128];
     new name[MAX_PLAYER_NAME];
     GetPlayerName(playerid, name, sizeof(name));
     format(string, sizeof(string), "%s, you recieved armor, health and money.", name));
     SendClientMessage(playerid, COLOR_GREEN, string);



Re: How do i get rid of these warnings?!? - RyDeR` - 18.01.2012

pawn Код:
GetPlayerName(playerid, string, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s, you recieved armor, health and money.", string);
SendClientMessage(playerid, COLOR_GREEN, string);



Re: How do i get rid of these warnings?!? - SchurmanCQC - 18.01.2012

Quote:
Originally Posted by bestr32
Посмотреть сообщение
pawn Код:
new pname[MAX_PLAYER_NAME]; //Defining pname as player's in-game name.
new string[156]; // Defining the string
GetPlayerName(playerid, pname, sizeof(pname)); // Using pname as getting player's name
format(string,sizeof(string), "%s, you received armor, health and money", pname); // Formating the string
SendClientMessage(playerid, COLOUR, string);
You bumped a thread from 2010. Good job, mate.