SA-MP Forums Archive
[AJUDA] Comando de respawn bugado - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [AJUDA] Comando de respawn bugado (/showthread.php?tid=242313)



[AJUDA] Comando de respawn bugado - Styles-P - 19.03.2011

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;
	}



Re: [AJUDA] Comando de respawn bugado - JonathanFeitosa - 19.03.2011

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;
            }



Re: [AJUDA] Comando de respawn bugado - Styles-P - 19.03.2011

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


Re: [AJUDA] Comando de respawn bugado - JonathanFeitosa - 19.03.2011

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;
            }



Re: [AJUDA] Comando de respawn bugado - Styles-P - 19.03.2011

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


Re: [AJUDA] Comando de respawn bugado - Macintosh - 19.03.2011

https://sampwiki.blast.hk/wiki/SetVehicleToRespawn


Re: [AJUDA] Comando de respawn bugado - Styles-P - 20.03.2011

Pow alguem poderia me ajudar ai veiu por favor


Re: [AJUDA] Comando de respawn bugado - Macintosh - 20.03.2011

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.