[AJUDA] Comando de respawn bugado
#1

bem criei um comando de respawn org, so que quando eu ponho /respawnorg 1, ele nao vai, fica falando /respawnorg [orgid] e nao vai. aki o comando
Код:
	if(strcmp(cmd, "/respawnorg", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if (PlayerInfo[playerid][pAdmin] >= 1)
					{
			if(admtrampando[playerid] < 1)
				{
	                SendClientMessage(playerid, COLOR_GREY, "   Vocк nao estб em modo adm!!");
	                return 1;
	            }
	            new x_nr[256];
	            new carid = strval(tmp);
				x_nr = strtok(cmdtext, idx);
				if(!strlen(x_nr)) {
				    SendClientMessage(playerid, COLOR_WHITE, "USE: /respawnorg [ orgid ]");
				    SendClientMessage(playerid, COLOR_WHITE, "Id validos : /np.");
					return 1;
				}
			    if(strcmp(x_nr,"1",true) == 0)
				{
		            tmp = strtok(cmdtext, idx);
					if(!strlen(tmp))
					{
					    SendClientMessage(playerid, COLOR_WHITE, "USE: /respawnorg [ orgid ]");
					    return 1;
					}
					giveplayerid = ReturnUser(tmp);
                    tmp = strtok(cmdtext, idx);
					if(IsPlayerConnected(giveplayerid))
					{
					    if(IsAPmCar(carid) != INVALID_VEHICLE_ID)
					    {
                            SetVehicleToRespawn(IsAPmCar(carid));
							return 1;
				        }
					}
					else
					{
					    SendClientMessage(playerid, COLOR_GREY, "   ID invalido !");
					    return 1;
					}
				}
			    if(strcmp(x_nr,"2",true) == 0)
				{
		            tmp = strtok(cmdtext, idx);
					if(!strlen(tmp))
					{
					    SendClientMessage(playerid, COLOR_WHITE, "USE: /respawnorg [ orgid ]");
					    return 1;
					}
					giveplayerid = ReturnUser(tmp);
                    tmp = strtok(cmdtext, idx);
					if(IsPlayerConnected(giveplayerid))
					{
					    if(IsABOPECar(carid) != INVALID_VEHICLE_ID)
					    {
                            SetVehicleToRespawn(IsABOPECar(carid));
							return 1;
				        }
					}
					else
					{
					    SendClientMessage(playerid, COLOR_GREY, "   ID invalido !");
					    return 1;
					}
				}
			    if(strcmp(x_nr,"3",true) == 0)
				{
		            tmp = strtok(cmdtext, idx);
					if(!strlen(tmp))
					{
					    SendClientMessage(playerid, COLOR_WHITE, "USE: /respawnorg [ orgid ]");
					    return 1;
					}
					giveplayerid = ReturnUser(tmp);
                    tmp = strtok(cmdtext, idx);
					if(IsPlayerConnected(giveplayerid))
					{
					    if(IsAExCar(carid) != INVALID_VEHICLE_ID)
					    {
                            SetVehicleToRespawn(IsAExCar(carid));
							return 1;
				        }
					}
					else
					{
					    SendClientMessage(playerid, COLOR_GREY, "   ID invalido !");
					    return 1;
					}
				}
			}
	        else
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo й ADM !");
	            return 1;
	        }
	    }
	    return 1;
	}
Reply
#2

pawn Код:
if(strcmp(cmd, "/respawnorg", true) == 0)
    {
    if (PlayerInfo[playerid][pAdmin] >= 1)
    {
    if(admtrampando[playerid] < 1)
    {
        SendClientMessage(playerid, COLOR_GREY, "   Vocк nao estб em modo adm!!");
    return 1;
    }
                new x_nr[256];
                new carid = strval(tmp);
                x_nr = strtok(cmdtext, idx);
                if(!strlen(x_nr)) {
                    SendClientMessage(playerid, COLOR_WHITE, "USE: /respawnorg [ orgid ]");
                    SendClientMessage(playerid, COLOR_WHITE, "Id validos : /np.");
                    return 1;
                }
                if(strcmp(x_nr,"1",true) == 0)
                {
                    giveplayerid = ReturnUser(tmp);
                    tmp = strtok(cmdtext, idx);
                    if(IsPlayerConnected(giveplayerid))
                    {
                        if(IsAPmCar(carid) != INVALID_VEHICLE_ID)
                        {
                            SetVehicleToRespawn(IsAPmCar(carid));
                            return 1;
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, "   ID invalido !");
                        return 1;
                    }
                }
                if(strcmp(x_nr,"2",true) == 0)
                {
                    giveplayerid = ReturnUser(tmp);
                    tmp = strtok(cmdtext, idx);
                    if(IsPlayerConnected(giveplayerid))
                    {
                        if(IsABOPECar(carid) != INVALID_VEHICLE_ID)
                        {
                            SetVehicleToRespawn(IsABOPECar(carid));
                            return 1;
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, "   ID invalido !");
                        return 1;
                    }
                }
                if(strcmp(x_nr,"3",true) == 0)
                {
                    giveplayerid = ReturnUser(tmp);
                    tmp = strtok(cmdtext, idx);
                    if(IsPlayerConnected(giveplayerid))
                    {
                        if(IsAExCar(carid) != INVALID_VEHICLE_ID)
                        {
                            SetVehicleToRespawn(IsAExCar(carid));
                            return 1;
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, "   ID invalido !");
                        return 1;
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo й ADM !");
                }
                return 1;
            }
Reply
#3

Quote:
Originally Posted by Jonathan_Feitosa
Посмотреть сообщение
pawn Код:
if(strcmp(cmd, "/respawnorg", true) == 0)
    {
    if (PlayerInfo[playerid][pAdmin] >= 1)
    {
    if(admtrampando[playerid] < 1)
    {
        SendClientMessage(playerid, COLOR_GREY, "   Vocк nao estб em modo adm!!");
    return 1;
    }
                new x_nr[256];
                new carid = strval(tmp);
                x_nr = strtok(cmdtext, idx);
                if(!strlen(x_nr)) {
                    SendClientMessage(playerid, COLOR_WHITE, "USE: /respawnorg [ orgid ]");
                    SendClientMessage(playerid, COLOR_WHITE, "Id validos : /np.");
                    return 1;
                }
                if(strcmp(x_nr,"1",true) == 0)
                {
                    giveplayerid = ReturnUser(tmp);
                    tmp = strtok(cmdtext, idx);
                    if(IsPlayerConnected(giveplayerid))
                    {
                        if(IsAPmCar(carid) != INVALID_VEHICLE_ID)
                        {
                            SetVehicleToRespawn(IsAPmCar(carid));
                            return 1;
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, "   ID invalido !");
                        return 1;
                    }
                }
                if(strcmp(x_nr,"2",true) == 0)
                {
                    giveplayerid = ReturnUser(tmp);
                    tmp = strtok(cmdtext, idx);
                    if(IsPlayerConnected(giveplayerid))
                    {
                        if(IsABOPECar(carid) != INVALID_VEHICLE_ID)
                        {
                            SetVehicleToRespawn(IsABOPECar(carid));
                            return 1;
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, "   ID invalido !");
                        return 1;
                    }
                }
                if(strcmp(x_nr,"3",true) == 0)
                {
                    giveplayerid = ReturnUser(tmp);
                    tmp = strtok(cmdtext, idx);
                    if(IsPlayerConnected(giveplayerid))
                    {
                        if(IsAExCar(carid) != INVALID_VEHICLE_ID)
                        {
                            SetVehicleToRespawn(IsAExCar(carid));
                            return 1;
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, "   ID invalido !");
                        return 1;
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo й ADM !");
                }
                return 1;
            }
Ta dando id invalido
Reply
#4

pawn Код:
if(strcmp(cmd, "/respawnorg", true) == 0)
    {
    if (PlayerInfo[playerid][pAdmin] >= 1)
    {
    if(admtrampando[playerid] < 1)
    {
        SendClientMessage(playerid, COLOR_GREY, "   Vocк nao estб em modo adm!!");
    return 1;
    }
                new x_nr[256];
                new carid = strval(tmp);
                x_nr = strtok(cmdtext, idx);
                if(!strlen(x_nr)) {
                    SendClientMessage(playerid, COLOR_WHITE, "USE: /respawnorg [ orgid ]");
                    SendClientMessage(playerid, COLOR_WHITE, "Id validos : /np.");
                    return 1;
                }
                if(strcmp(x_nr,"1",true) == 0)
                {
                    giveplayerid = ReturnUser(tmp);
                    tmp = strtok(cmdtext, idx);
                    if(IsPlayerConnected(giveplayerid))
                    {
                        if(IsAPmCar(carid) != INVALID_VEHICLE_ID)
                        {
                            SetVehicleToRespawn(IsAPmCar(carid));
                            }
                            }
                            return 1;
                        }

                if(strcmp(x_nr,"2",true) == 0)
                {
                    giveplayerid = ReturnUser(tmp);
                    tmp = strtok(cmdtext, idx);
                    if(IsPlayerConnected(giveplayerid))
                    {
                        if(IsABOPECar(carid) != INVALID_VEHICLE_ID)
                        {
                            SetVehicleToRespawn(IsABOPECar(carid));
                            return 1;
                        }
                    }
                }
                if(strcmp(x_nr,"3",true) == 0)
                {
                    giveplayerid = ReturnUser(tmp);
                    tmp = strtok(cmdtext, idx);
                    if(IsPlayerConnected(giveplayerid))
                    {
                        if(IsAExCar(carid) != INVALID_VEHICLE_ID)
                        {
                            SetVehicleToRespawn(IsAExCar(carid));
                            return 1;
                        }
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo й ADM !");
                }
                return 1;
            }
Reply
#5

Quote:
Originally Posted by Jonathan_Feitosa
Посмотреть сообщение
pawn Код:
if(strcmp(cmd, "/respawnorg", true) == 0)
    {
    if (PlayerInfo[playerid][pAdmin] >= 1)
    {
    if(admtrampando[playerid] < 1)
    {
        SendClientMessage(playerid, COLOR_GREY, "   Vocк nao estб em modo adm!!");
    return 1;
    }
                new x_nr[256];
                new carid = strval(tmp);
                x_nr = strtok(cmdtext, idx);
                if(!strlen(x_nr)) {
                    SendClientMessage(playerid, COLOR_WHITE, "USE: /respawnorg [ orgid ]");
                    SendClientMessage(playerid, COLOR_WHITE, "Id validos : /np.");
                    return 1;
                }
                if(strcmp(x_nr,"1",true) == 0)
                {
                    giveplayerid = ReturnUser(tmp);
                    tmp = strtok(cmdtext, idx);
                    if(IsPlayerConnected(giveplayerid))
                    {
                        if(IsAPmCar(carid) != INVALID_VEHICLE_ID)
                        {
                            SetVehicleToRespawn(IsAPmCar(carid));
                            }
                            }
                            return 1;
                        }

                if(strcmp(x_nr,"2",true) == 0)
                {
                    giveplayerid = ReturnUser(tmp);
                    tmp = strtok(cmdtext, idx);
                    if(IsPlayerConnected(giveplayerid))
                    {
                        if(IsABOPECar(carid) != INVALID_VEHICLE_ID)
                        {
                            SetVehicleToRespawn(IsABOPECar(carid));
                            return 1;
                        }
                    }
                }
                if(strcmp(x_nr,"3",true) == 0)
                {
                    giveplayerid = ReturnUser(tmp);
                    tmp = strtok(cmdtext, idx);
                    if(IsPlayerConnected(giveplayerid))
                    {
                        if(IsAExCar(carid) != INVALID_VEHICLE_ID)
                        {
                            SetVehicleToRespawn(IsAExCar(carid));
                            return 1;
                        }
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo й ADM !");
                }
                return 1;
            }
Cara o comando nao ta funfando os carros nao da respawn
Reply
#6

https://sampwiki.blast.hk/wiki/SetVehicleToRespawn
Reply
#7

Pow alguem poderia me ajudar ai veiu por favor
Reply
#8

pawn Код:
stock RespawnExercito(playerid)
{
 for(new c=0; c<MAX_VEHICLES; c++;)
 {
  CarExercito[0];
  CarExercito[1];
  CarExercito[2];
  CarExercito[3];
 }
 return 1;
}
pawn Код:
public OnGameModeInit()
{
 CarExercito[0] = AddStaticVehicle(...
 return 1;
}
pawn Код:
if(strcmp(cmd, "/respawnarexercito", true) == 0)
{
 if(!IsPlayerAdmin(playerid))
 {
  SendClientMessage(playerid,Cor,"[ERRO] Nгo йs Admin!");
  return 1;
 }
 SetVehicleToRespawn(playerid, RespawnExercito);
 return 1;
}
Mais ou Menos assim .__.
Fiz na pressa.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)