[AJUDA]Comando
#1

Mais uma ajudinha aqui Pf

O comando esta funcionando normal mais qria que tipo fosse criado mбximo de tapetes 10/10
tipo se um jogador criar um 1/10 c outro jogador criar um 2/10 e assim vai
se tiver 10/10 criado jб jogador nenhum poderб criar ate um tapete destruir


alguйm sabe e pode me ajudar


Код:
if(strcmp(cmdtext,"/tapete", true) == 0) {
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(dini_Int(file, "Profissao") == Policia_Civil || dini_Int(file, "Profissao") == Policia_Federal || dini_Int(file, "Profissao") == Interpol || dini_Int(file, "Profissao") == Delegado || dini_Int(file, "Profissao") == Bope || dini_Int(file, "Profissao") == Swat || dini_Int(file, "Profissao") == Narcoticos || dini_Int(file, "Profissao") == Policia_Militar || dini_Int(file, "Profissao") == FBI || dini_Int(file, "Profissao") == Policia_Rodoviaria || dini_Int(file, "aAdmin") == 1){
if(CDT[playerid] == 0)
{
CDT[playerid] = 1;
GetPlayerPos(playerid,xx,yy,zz);
GetPlayerFacingAngle(playerid, B);
Tapete = CreateObject(2899, xx, yy, zz-0.9, 0, 0,B-90, 300.0);
GameTextForPlayer(playerid,"~w~Tapede criado :)",6000,1);
SetTimerEx("DestruirObjeto",600000,false,"d",Tapete);
return 1;
}
if(CDT[playerid] == 1)
{
CDT[playerid] = 0;
DestroyObject(Tapete);
GameTextForPlayer(playerid,"~w~Tapede Deletado",6000,1);
xx=0,
yy=0,
zz=0;
return 1;
}
} else {
SendClientMessage(playerid,Vermelho,"(ERRO) Vocк nгo й um Policial!");
}
return 1;
}
}
Reply
#2

Acho que funciona:

PHP код:
public OnPlayerConnect(playerid)
{
    
CDT[playerid] = -1;
    return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if(
strcmp(cmdtext,"/tapete"true) == 0
    {
        new 
aname[MAX_PLAYER_NAME];
        
GetPlayerName(playeridanameMAX_PLAYER_NAME);
        
format(filesizeof(file), PASTA_CONTASaname);
        if(
dini_Int(file"Profissao") == Policia_Civil || dini_Int(file"Profissao") == Policia_Federal || dini_Int(file"Profissao") == Interpol || dini_Int(file"Profissao") == Delegado || dini_Int(file"Profissao") == Bope || dini_Int(file"Profissao") == Swat || dini_Int(file"Profissao") == Narcoticos || dini_Int(file"Profissao") == Policia_Militar || dini_Int(file"Profissao") == FBI || dini_Int(file"Profissao") == Policia_Rodoviaria || dini_Int(file"aAdmin") == 1)
        {
            if(
Tapete >= 10) return SendClientMessage(playerid0xFF0000FF"Sу podem ser criados 10 tapetes ao mesmo tempo.");
            if(
CDT[playerid] == -1)
            {
                
Tapete++;
                
GetPlayerPos(playerid,xx,yy,zz);
                
GetPlayerFacingAngle(playeridB);
                
CDT[playerid] = CreateObject(2899xxyyzz-0.900,B-90300.0);
                
GameTextForPlayer(playerid,"~w~Tapete criado :)",6000,1);
                
SetTimerEx("DestruirObjeto",600000,false,"d",Tapete);
                return 
1;
            }
            else
            {
                
Tapete--;
                
DestroyObject(CDT[playerid]);
                
CDT[playerid] = -1;
                
GameTextForPlayer(playerid,"~w~Tapete Deletado",6000,1);
                return 
1;
            }
        } 
        else { 
SendClientMessage(playerid,Vermelho,"(ERRO) Vocк nгo й um Policial!"); }
        return 
1;
    }
    return 
0;

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)