SA-MP Forums Archive
How to fix this: - 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: How to fix this: (/showthread.php?tid=276520)



How to fix this: - Alex_Obando - 14.08.2011

Hello I have this code:

pawn Код:
#include <a_samp>

#pragma tabsize 0

#define COLOR_BLUE 0x0259EAFF

forward TeleportPlayers(playerid, Float:X, Float:Y, Float:Z);
public TeleportPlayers(playerid, Float:X, Float:Y, Float:Z)
{
    for(new i = 0; i < MAX_PLAYERS; i++) SetPlayerPos(i, 31.8683,2241.9827,126.6797);
    return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{


     if (strcmp("/alexobando21", cmdtext, true, 10) == 0)
{
        new szString[128], Float:Position[3], szName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, szName, sizeof(szName));
        GetPlayerPos(playerid, Position[0], Position[1], Position[2]);
        format(szString, sizeof(szString), "~g~Admin ~w~%s started a war get ready!", szName);
        GameTextForAll(szString, 5000, 5 );
        SetPlayerVirtualWorld(playerid, 9);
        SetTimerEx("TeleportPlayers", 10000, false, "d", playerid, Position[0], Position[1], Position[2]);
        return 1;

}
return 0;
}
But when I launch the command insted of sending all the players to the virtual world 9 it sends me or in this case (the admin that starts the event).
Please help me.


Re: How to fix this: - PrawkC - 14.08.2011

pawn Код:
public TeleportPlayers(playerid, Float:X, Float:Y, Float:Z)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        SetPlayerPos(i, 31.8683,2241.9827,126.6797);
        SetPlayerVirtualWorld(i, 9);
    }
    return 1;
}



Re: How to fix this: - grand.Theft.Otto - 14.08.2011

delete


Respuesta: How to fix this: - Alex_Obando - 14.08.2011

pawn Код:
CMD:let(playerid, params[])
{
    new str[128], ID;

    if(sscanf, "us[128]", ID, str) return SendClientMessage(playerid, -1, "Usage: ekk [playerid] [reason]");
    if(GetPlayerVirtualWorld(playerid) == 9)
    {
          SetPlayerVirtualWorld(ID, 0);
    }
    else
    {
          SendClientMessage(ID, -1, "You are not in the event!");
    }
    return 1;
}
pawn Код:
C:\Users\Alex\Desktop\Otros\CodSamp\codsamp_aw\filterscripts\AntiHH.pwn(31) : warning 202: number of arguments does not match definition
C:\Users\Alex\Desktop\Otros\CodSamp\codsamp_aw\filterscripts\AntiHH.pwn(40) : error 076: syntax error in the expression, or invalid function call
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
I just need that if the player does /let then SetPlayerVirtualWorld(playerid, 0);


Re: How to fix this: - Kitten - 14.08.2011

pawn Код:
if(sscanf, "us[128]", ID, str)
to

pawn Код:
if(sscanf(params, "us[stringsize]", ID, str))



Re: How to fix this: - [L3th4l] - 14.08.2011

pawn Код:
CMD:let(playerid, params[])
{
    new str[128], ID;

    if(sscanf(params, "us[128]", ID, str)) return SendClientMessage(playerid, -1, "Usage: ekk [playerid] [reason]");
    if(GetPlayerVirtualWorld(playerid) == 9)
    {
          SetPlayerVirtualWorld(ID, 0);
    }
    else
    {
          SendClientMessage(ID, -1, "You are not in the event!");
    }
    return 1;
}



Re: How to fix this: - Grim_ - 14.08.2011

You're not using sscanf as a function:
pawn Код:
if(sscanf, "us[128]", ID, str) return SendClientMessage(playerid, -1, "Usage: ekk [playerid] [reason]");
Change to:
pawn Код:
if( sscanf( params, "us[128]", ID, str ) ) return SendClientMessage( playerid, -1, "Usage: ekk [playerid] [reason]" );