[Ajuda] comando /setworld
#5

Pode usar isso como Filterscript que vai funcionar

Код:
#include <a_samp>

public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[100], idx;
    cmd = strtok(cmdtext, idx);
    
    if (strcmp("/setworld", cmd, true) == 0)
    {
    if (IsPlayerAdmin(playerid))
    {
    new tmp1[128], tmp2[128];
    tmp1 = strtok(cmdtext, idx);
    tmp2 = strtok(cmdtext, idx);
    if (!strlen(tmp1) || !strlen(tmp2)) return SendClientMessage(playerid, -1, "{FFFFFF}Use: /setworld [player] [world]");
    if (IsPlayerConnected(strval(tmp1))) return SendClientMessage(playerid, -1, "{FFFFFF}Player nгo conectado.");
    SetPlayerVirtualWorld(strval(tmp1),strval(tmp2));
 }
    return 1;
 }
	return 0;
}


strtok(const string[], &index)
{
   new length = strlen(string);
   while ((index < length) && (string[index] <= ' '))
   {
      index++;
   }
   new offset = index;
   new result[20];
   while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
   {
      result[index - offset] = string[index];
      index++;
   }
   result[index - offset] = EOS;
   return result;
}
Reply


Messages In This Thread
comando /setworld - by safchdion - 25.07.2016, 04:06
Respuesta: comando /setworld - by SammyJ - 25.07.2016, 04:17
Re: Respuesta: comando /setworld - by safchdion - 25.07.2016, 04:20
Re: comando /setworld - by safchdion - 25.07.2016, 04:37
Re: comando /setworld - by RedMF - 25.07.2016, 05:41
Re: comando /setworld - by safchdion - 25.07.2016, 09:49
Re: comando /setworld - by RedMF - 25.07.2016, 16:39
Re: comando /setworld - by pPawn - 25.07.2016, 21:02
Re: comando /setworld - by safchdion - 25.07.2016, 22:19

Forum Jump:


Users browsing this thread: 1 Guest(s)