SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 30/12/2019, 04:41 PM   #1
TwunZ
Little Clucker
 
Join Date: Jan 2017
Posts: 47
Reputation: 0
Default Good I am trying to have role commands on / b / me / do / s

Good I am trying to have role commands on / b / me / do / s in a pawno but it does not work I get a warning you know what the fault is and I put it on and this is what jumps me
Quote:
forward MensajeCercanos(playerid, color, str[], Float:radius);

public MensajeCercanos(playerid, color, str[], Float:radius)
{
new Float: PosicionX, Float: PosicionY, Float: PosicionZ;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(playerid))
{
GetPlayerPos(playerid, PosicionX, PosicionY, PosicionZ);
if(IsPlayerInRangeOfPoint(i, radius, PosicionX, PosicionY, PosicionZ))
{
if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i) && GetPlayerInterior(playerid) == GetPlayerInterior(i))
{
SendClientMessage(i, color, str);
}
}
}
}
return 1;
}

///////////////////////-----------===============================[ - Comandos - ]===============================-----------//////////////////////////////////////////
COMMANDo(playerid, params[])
{
new message[128], str[128];
if(sscanf(params,"s[128]", message))return SendClientMessage(playerid, -1," Utiliza: /me [accion]");
format(str, sizeof(str), "%s [ se oye.. %s ]", GetPlayerName(playerid), message);
MensajeCercanos(playerid, 0x51B2F6FF, str, 12);
return 1;
}

COMMAND:ame(playerid, params[])
{
new message[128], str[128];
if(sscanf(params,"s[128]", message))return SendClientMessage(playerid, -1,"Utiliza: /me [accion]");
format(str, sizeof(str), "%s [ %s ]", GetPlayerName(playerid), message);
MensajeCercanos(playerid, 0xF6BC07F6, str, 12);
return 1;
}

COMMAND:me(playerid, params[])
{
new message[128], str[128];
if(sscanf(params,"s[128]", message))return SendClientMessage(playerid, -1,"Utiliza: /me [accion]");
format(str, sizeof(str), "%s %s", GetPlayerName(playerid), message);
MensajeCercanos(playerid, 0xD837F6FF, str, 12);
return 1;
}

COMMAND:do(playerid, params[])
{
new message[128], str[128];
if(sscanf(params,"s[128]", message))return SendClientMessage(playerid, -1,"Utiliza: /do [texto]");
format(str, sizeof(str), "%s ((%s))",message, GetPlayerName(playerid));
MensajeCercanos(playerid, 0x51F645FF, str, 12);
return 1;
}

CMD:b(playerid,params[])
{
new string[126];
if(isnull(params)) return SendClientMessage(playerid, -1,"/b [Chat Local]");
format(string, sizeof(string), "[OOC] %s: (( %s ))", GetPlayerName(playerid), params);
MensajeCercanos(playerid, 0xCECECEFF, string, 12);
return 1;
}


COMMAND(playerid, params[])
{
new message[128], str[128];
if(sscanf(params,"s[128]", message))return SendClientMessage(playerid, -1," Usa: /s{usurrar} [mensaje]");
if(strlen(message) < 1) return SendClientMessage(playerid, -1," Texto muy corto");
if(strlen(message) > 100) return SendClientMessage(playerid, -1," Texto muy largo"); new jtext[30];
format(str, sizeof(str), "%s susurra : %s",GetPlayerName(playerid), message);
MensajeCercanos(playerid, -1, str, 5);
return 1;
}

COMMAND:g(playerid, params[])
{
new message[128], str[128];
if(sscanf(params,"s[128]", message))return SendClientMessage(playerid, -1,"Usa: /gritar [mensaje]");
if(strlen(message) < 1) return SendClientMessage(playerid, -1,"Texto muy corto");
if(strlen(message) > 100) return SendClientMessage(playerid, -1,"Texto muy largo");
format(str, sizeof(str), "%s grita : %s!",GetPlayerName(playerid), message);
MensajeCercanos(playerid, -1, str, 16);
return 1;
}
los warning
Quote:
C:\Users\Gomez\Desktop\servidor\gamemodes\gm.pwn(5 3 : warning 202: number of arguments does not match definition
C:\Users\Gomez\Desktop\servidor\gamemodes\gm.pwn(5 3 : warning 202: number of arguments does not match definition
C:\Users\Gomez\Desktop\servidor\gamemodes\gm.pwn(5 47) : warning 202: number of arguments does not match definition
C:\Users\Gomez\Desktop\servidor\gamemodes\gm.pwn(5 47) : warning 202: number of arguments does not match definition
C:\Users\Gomez\Desktop\servidor\gamemodes\gm.pwn(5 56) : warning 202: number of arguments does not match definition
C:\Users\Gomez\Desktop\servidor\gamemodes\gm.pwn(5 56) : warning 202: number of arguments does not match definition
C:\Users\Gomez\Desktop\servidor\gamemodes\gm.pwn(5 65) : warning 202: number of arguments does not match definition
C:\Users\Gomez\Desktop\servidor\gamemodes\gm.pwn(5 65) : warning 202: number of arguments does not match definition
C:\Users\Gomez\Desktop\servidor\gamemodes\gm.pwn(5 74) : warning 202: number of arguments does not match definition
C:\Users\Gomez\Desktop\servidor\gamemodes\gm.pwn(5 74) : warning 202: number of arguments does not match definition
C:\Users\Gomez\Desktop\servidor\gamemodes\gm.pwn(5 86) : warning 202: number of arguments does not match definition
C:\Users\Gomez\Desktop\servidor\gamemodes\gm.pwn(5 86) : warning 202: number of arguments does not match definition
C:\Users\Gomez\Desktop\servidor\gamemodes\gm.pwn(5 85) : warning 204: symbol is assigned a value that is never used: "jtext"
C:\Users\Gomez\Desktop\servidor\gamemodes\gm.pwn(5 97) : warning 202: number of arguments does not match definition
C:\Users\Gomez\Desktop\servidor\gamemodes\gm.pwn(5 97) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


15 Warnings.
__________________
Hola, soy TwunZ
Que vuelva Español/Spanish
To come backEspañol/Spanish

Español/Spanish
TwunZ is offline   Reply With Quote
Old 30/12/2019, 04:59 PM   #2
Calisthenics
Gangsta
 
Join Date: May 2018
Posts: 953
Reputation: 167
Default Re: Good I am trying to have role commands on / b / me / do / s

https://wiki.sa-mp.com/wiki/GetPlayerName

Read the example to see how to use `GetPlayerName` function.
__________________
Calisthenics is offline   Reply With Quote
Old 30/12/2019, 05:09 PM   #3
TwunZ
Little Clucker
 
Join Date: Jan 2017
Posts: 47
Reputation: 0
Default Re: Good I am trying to have role commands on / b / me / do / s

I don't know how you could explain it to me with an example of what happened?
__________________
Hola, soy TwunZ
Que vuelva Español/Spanish
To come backEspañol/Spanish

Español/Spanish
TwunZ is offline   Reply With Quote
Old 30/12/2019, 05:51 PM   #4
Calisthenics
Gangsta
 
Join Date: May 2018
Posts: 953
Reputation: 167
Default Re: Good I am trying to have role commands on / b / me / do / s

Your code:
pawn Code:
GetPlayerName(playerid)
The native function:
pawn Code:
native GetPlayerName(playerid, name[], len);
The example:
pawn Code:
new name[MAX_PLAYER_NAME + 1];
GetPlayerName(playerid, name, sizeof(name));
The warning:
pawn Code:
warning 202: number of arguments does not match definition
Conclusion: You used 1 parameter, the function has 3 parameters.
__________________
Calisthenics is offline   Reply With Quote
Old 30/12/2019, 10:33 PM   #5
Beckett
High-roller
 
Beckett's Avatar
 
Join Date: Feb 2012
Location: www.finalnights-rp.com
Posts: 1,769
Reputation: 100
Default Re: Good I am trying to have role commands on / b / me / do / s

That's not how GetPlayerName is used. You need to assign a variable with MAX_PLAYER_NAME as its length, store the player's name in it then display it in the message through that variable.
Beckett is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tutorial] Making good Role-Play server. Whatsapp Tutorials 15 08/12/2013 03:56 PM
Any good role playing sever can introduce for me? S05022 General 15 27/06/2012 08:13 AM
[FilterScript] [FS]Motel (GOOD FOR ROLE PLAY) empty_full Filterscripts 19 27/02/2012 04:13 PM
[FS/MAP] ||<< Steam Bath - Good For Role Play *RP*>>|| Fre$hKidd Filterscripts 44 21/12/2011 05:30 AM
Looking for a good Role-play server.. Brice|Bryce General 2 08/03/2010 01:28 PM


All times are GMT. The time now is 12:21 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.