08.07.2011, 02:23
Acho que funciona:
PHP код:
public OnPlayerConnect(playerid)
{
CDT[playerid] = -1;
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
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(Tapete >= 10) return SendClientMessage(playerid, 0xFF0000FF, "Sу podem ser criados 10 tapetes ao mesmo tempo.");
if(CDT[playerid] == -1)
{
Tapete++;
GetPlayerPos(playerid,xx,yy,zz);
GetPlayerFacingAngle(playerid, B);
CDT[playerid] = CreateObject(2899, xx, yy, zz-0.9, 0, 0,B-90, 300.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;
}