SA-MP Forums Archive
Help again. - 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: Help again. (/showthread.php?tid=345045)



Help again. - HighPitchedVoice - 23.05.2012

pawn Код:
if (strcmp("/tele", cmdtext, true, 10) == 0)
    {
        SetPlayerPos(playerid, 1790.5925,-1439.5399,13.4210);
        SendClientMessage(playerid, GREEN , "You have successfully teleported away.");
        SendMessageToAll(GREEN, "%s went to test.");
        return 1;
    }
It dosn't send the "SendMessageToAll" :S


Re: Help again. - ViniBorn - 23.05.2012

Use GetPlayerName + format + SendClientMessageToAll


Re: Help again. - iGetty - 23.05.2012

Does it set the position and send the first client message? and what was said above.


Re: Help again. - HighPitchedVoice - 23.05.2012

Yes, it does iGetty.


Re: Help again. - [FMJ]PowerSurge - 23.05.2012

What is "SendMessageToAll"?

And depending on what 'SendMessageToAll' actually is, you may need to format a string and use it or add extra parameters to the end of SendMessageToAll.


Re: Help again. - thefatshizms - 23.05.2012

Quote:
Originally Posted by HighPitchedVoice
Посмотреть сообщение
Yes, it does iGetty.
yo need to format the string like so:
pawn Код:
if (strcmp("/tele", cmdtext, true, 10) == 0)
    {
        new str[128];
        format(str sizeof(str), "%s has went to test", GetName(playerid));
        SetPlayerPos(playerid, 1790.5925,-1439.5399,13.4210);
        SendClientMessage(playerid, GREEN , "You have successfully teleported away.");
        SendClientMessageToAll(GREEN, str);
        return 1;
    }



Re: Help again. - [D]ry[D]esert - 23.05.2012

try this:
pawn Код:
if (strcmp("/tele", cmdtext, true, 10) == 0)
    {
    new pName[MAX_PLAYER_NAME],str[100];
    GetPlayerName(playerid,pName,sizeof(pName));
    format(str,sizeof(str)," %s went to test",pName);
    SetPlayerPos(playerid, 1790.5925,-1439.5399,13.4210);
    SendClientMessageToAll(-1,str);
    return 1;
    }



Re: Help again. - HighPitchedVoice - 23.05.2012

Thank you.