SA-MP Forums Archive
sendclientmessagetoall prob - 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: sendclientmessagetoall prob (/showthread.php?tid=151999)



sendclientmessagetoall prob - Kar - 01.06.2010

SendClientMessageToAll("%s has stolen %d From %s");
Код:
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SAMPSE~1\GAMEMO~1\COPSNR~1.pwn(403) : error 035: argument type mismatch (argument 1)

1 Error.



Re: sendclientmessagetoall prob - Antonio [G-RP] - 01.06.2010

Show us the code?


Re: sendclientmessagetoall prob - Carlton - 01.06.2010

Quote:
Originally Posted by Kar
SendClientMessageToAll("%s has stolen %d From %s");
Код:
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SAMPSE~1\GAMEMO~1\COPSNR~1.pwn(403) : error 035: argument type mismatch (argument 1)

1 Error.
Your parameters are not correct, and you need to format your text to use %s, and %d.


Re: sendclientmessagetoall prob - Toni - 01.06.2010

If you want to make a string, do this

pawn Код:
new string[128];
new Probber[MAX_PLAYER_NAME];
new Pstolen[MAX_PLAYER_NAME];
GetPlayerName(playerid, Pname, Pstolen, sizeof(Pname, Pstolen));
format(string, sizeof(string), "%s has Stolen %d from %s", Probber, Pstolen);
SendClientMessageToAll(0xFFFFFFF, string);
Thats not fully correct, but idk how to do the rest.


Re: sendclientmessagetoall prob - Kar - 01.06.2010

i wanna make it like.. [NAME] has stolen [cash amount] from [SFBANK] or which ever other bank

Код:
if(strcmp(cmdtext, "/robbank", true) == 0) // If they type /robbank
{
  if(IsPlayerInCheckpoint(playerid, 2312.6365, -6.3147, 26.7422)) // Check if they are in a checkpoint
  {
    new cash = random(60000); // random number between 1 & 60000 is the money they will get
    GivePlayerMoney(playerid, cash); // Give the player the money!
    SendClientMessageToAll("%s has stolen %d From %s");
}
from the above^ string
Код:
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SAMPSE~1\GAMEMO~1\COPSNR~1.pwn(405) : error 017: undefined symbol "Pname"
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SAMPSE~1\GAMEMO~1\COPSNR~1.pwn(405) : error 017: undefined symbol "Pname"
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SAMPSE~1\GAMEMO~1\COPSNR~1.pwn(405) : error 029: invalid expression, assumed zero
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SAMPSE~1\GAMEMO~1\COPSNR~1.pwn(405) : fatal error 107: too many error messages on one line



Re: sendclientmessagetoall prob - Toni - 01.06.2010

Quote:
Originally Posted by Kar
i wanna make it like.. [NAME] has stolen [cash amount] from [SFBANK] or which ever other bank

Код:
if(strcmp(cmdtext, "/robbank", true) == 0) // If they type /robbank
{
  if(IsPlayerInCheckpoint(playerid, 2312.6365, -6.3147, 26.7422)) // Check if they are in a checkpoint
  {
    new cash = random(60000); // random number between 1 & 60000 is the money they will get
    GivePlayerMoney(playerid, cash); // Give the player the money!
    SendClientMessageToAll("%s has stolen %d From %s");
}
Thats not correct, you can't create a string without formatting. But i see what you mean


Re: sendclientmessagetoall prob - Toni - 01.06.2010

Quote:
Originally Posted by Tɧ϶ Tσηί™
Quote:
Originally Posted by Kar
i wanna make it like.. [NAME] has stolen [cash amount] from [SFBANK] or which ever other bank

Код:
if(strcmp(cmdtext, "/robbank", true) == 0) // If they type /robbank
{
  if(IsPlayerInCheckpoint(playerid, 2312.6365, -6.3147, 26.7422)) // Check if they are in a checkpoint
  {
    new cash = random(60000); // random number between 1 & 60000 is the money they will get
    GivePlayerMoney(playerid, cash); // Give the player the money!
    SendClientMessageToAll("%s has stolen %d From %s");
}
Thats not correct, you can't create a string without formatting. but i see what you mean
EDIT: Sorry for double post, lagg


Re: sendclientmessagetoall prob - VinceQc - 01.06.2010

https://sampwiki.blast.hk/wiki/Scripting_Basics#Strings


Re: sendclientmessagetoall prob - [NYRP]Mike. - 01.06.2010

pawn Код:
if(strcmp(cmdtext, "/robbank", true) == 0) // If they type /robbank
{
  if(IsPlayerInCheckpoint(playerid, 2312.6365, -6.3147, 26.7422)) // Check if they are in a checkpoint
  {
    new string[128];
    new playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,playername,sizeof(playername));
    new cash = random(60000); // random number between 1 & 60000 is the money they will get
    GivePlayerMoney(playerid, cash); // Give the player the money!
    format(string,sizeof(string),"%s has just stolen %s from the bank!",playername,cash);
    SendClientMessageToAll(COLOR_WHITE,string);
    }
    return 1;
}



Re: sendclientmessagetoall prob - Kar - 02.06.2010

THX SHADOW AND VINCE PROBLEM FIXED.