PHP код:
{
/cinto e /tirarcinto
//====================================[Cinto=========================================
if(!strcmp(cmdtext, "/cinto", true))
{
if(IsPlayerInAnyVehicle(playerid))
{
if(CintoPlayer[playerid] == 0)
{
CintoPlayer[playerid] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
SendClientMessage(playerid, COLOR_YELLOW,"[BHF] Parabйns Vocк estб de Cinto, Agora Estб Protegido (/tirarcinto)");
format(string, sizeof(string), "%s coloca o cinto de seguranзa.", sendername);
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
SendClientMessage(playerid, COLOR_YELLOW,"[BHF] Vocк jб estб de cinto.");
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE,"Vocк nгo estб em um Veiculo");
}
return 1;
}
//===================================================================
if(!strcmp(cmdtext, "/tirarcinto", true))
{
if(IsPlayerInAnyVehicle(playerid))
{
if(CintoPlayer[playerid] == 1)
{
CintoPlayer[playerid] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
SendClientMessage(playerid, COLOR_YELLOW,"[BHF] Cuidado Vocк Esta Sem Cinto, Pode Morrer (/cinto)");
format(string, sizeof(string), "%s retira o cinto de seguranзa.", sendername);
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
SendClientMessage(playerid, COLOR_YELLOW,"[BHF] Vocк jб estб sem cinto.");
}
}
else
{
SendClientMessage(playerid, COLOR_YELLOW,"[BSG] Vocк nгo estб em um veнculo.");
}
return 1;
}
ModelID,
ObjectID[MAX_PLAYERS],
Float:ox,
Float:oy,
Float:oz,
Float:orx,
Float:ory,
Float:orz,
Float:ovdist,
bool:ObjectCreated[MAX_PLAYERS],
}
new ObjectInfo[Ilde_MAX_OBJECTS][OInfo];
new bool:ObjectUpdatetRunning;
new bool:CantCreateMore;
new bool:RefreshObjects[MAX_PLAYERS];
new Float:OldX[MAX_PLAYERS], Float:OldY[MAX_PLAYERS], Float:OldZ[MAX_PLAYERS];
forward Ilde_ObjectUpdate(bool:DontCheckDistance);
forward Ilde_StartUpdate();
public Ilde_StartUpdate()
{
SetTimer("Ilde_ObjectUpdate", UpdateTime, 1);
}
stock Ilde_CreateObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, Float:vdist=0.0)
{
if(ObjectUpdatetRunning == false)
{
SetTimer("Ilde_StartUpdate", Ilde_MAX_OBJECTS/2, 0);
ObjectUpdatetRunning = true;
}
new objectid;
if(CantCreateMore == false)
{
for(new i; i<Ilde_MAX_OBJECTS; i++)
{
if(i == Ilde_MAX_OBJECTS-1)
{
printf("Only the first %i objects could be created - object limit exceeded.", Ilde_MAX_OBJECTS);
CantCreateMore = true;
}
if(ObjectInfo[i][ModelID] == 0)
{
objectid = i;
break;
}
}
}
else
{
return -1;
}
if(modelid == 0)
{
printf("Invalid modelid for object %i", objectid);
return -1;
}
ObjectInfo[objectid][ModelID] = modelid;
ObjectInfo[objectid][ox] = x;
ObjectInfo[objectid][oy] = y;
ObjectInfo[objectid][oz] = z;
ObjectInfo[objectid][orx] = rx;
ObjectInfo[objectid][ory] = ry;
ObjectInfo[objectid][orz] = rz;
ObjectInfo[objectid][ovdist] = vdist;
return objectid;
}
stock Ilde_IsValidObject(objectid)
{
if(ObjectInfo[objectid][ModelID] == 0 || objectid == -1)
{
return 0;
}
return 1;
}
Vocк criou o comando dentro de uma array e por isso bugou tudo.....
Код:
{
ModelID,
ObjectID[MAX_PLAYERS],
Float:ox,
Float:oy,
Float:oz,
Float:orx,
Float:ory,
Float:orz,
Float:ovdist,
bool:ObjectCreated[MAX_PLAYERS],
}
new ObjectInfo[Ilde_MAX_OBJECTS][OInfo];
new bool:ObjectUpdatetRunning;
new bool:CantCreateMore;
new bool:RefreshObjects[MAX_PLAYERS];
new Float:OldX[MAX_PLAYERS], Float:OldY[MAX_PLAYERS], Float:OldZ[MAX_PLAYERS];
forward Ilde_ObjectUpdate(bool:DontCheckDistance);
forward Ilde_StartUpdate();
public Ilde_StartUpdate()
{
SetTimer("Ilde_ObjectUpdate", UpdateTime, 1);
}
stock Ilde_CreateObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, Float:vdist=0.0)
{
if(ObjectUpdatetRunning == false)
{
SetTimer("Ilde_StartUpdate", Ilde_MAX_OBJECTS/2, 0);
ObjectUpdatetRunning = true;
}
new objectid;
if(CantCreateMore == false)
{
for(new i; i<Ilde_MAX_OBJECTS; i++)
{
if(i == Ilde_MAX_OBJECTS-1)
{
printf("Only the first %i objects could be created - object limit exceeded.", Ilde_MAX_OBJECTS);
CantCreateMore = true;
}
if(ObjectInfo[i][ModelID] == 0)
{
objectid = i;
break;
}
}
}
else
{
return -1;
}
if(modelid == 0)
{
printf("Invalid modelid for object %i", objectid);
return -1;
}
ObjectInfo[objectid][ModelID] = modelid;
ObjectInfo[objectid][ox] = x;
ObjectInfo[objectid][oy] = y;
ObjectInfo[objectid][oz] = z;
ObjectInfo[objectid][orx] = rx;
ObjectInfo[objectid][ory] = ry;
ObjectInfo[objectid][orz] = rz;
ObjectInfo[objectid][ovdist] = vdist;
return objectid;
}
stock Ilde_IsValidObject(objectid)
{
if(ObjectInfo[objectid][ModelID] == 0 || objectid == -1)
{
return 0;
}
return 1;
}