Sistema Cinto de Segurança
Bom, essa FS é uma bem legalzinha, da para você ver o cinto de segurança (coisa que algumas FS do tipo não fazem xD)
Imagens:
http://postimage.org/image/guh0785ux/
http://postimage.org/image/ggouz40ix/
http://postimage.org/image/kmmqhqh7t/
Pastebin:
Pessoal caso haja algum erro na tradução por exemplo: Você colocou o cinto , inves de Você tirou o cinto me avisem pois eu tive que traduzir de frances para portugues. Obrigado!
Bom, essa FS é uma bem legalzinha, da para você ver o cinto de segurança (coisa que algumas FS do tipo não fazem xD)
Imagens:
http://postimage.org/image/guh0785ux/
http://postimage.org/image/ggouz40ix/
http://postimage.org/image/kmmqhqh7t/
Pastebin:
- Código:
// is not a filterscript
// put in Game Mode
new Seatbelt[MAX_PLAYERS];
new Helmet[MAX_PLAYERS];
public OnPlayerExitVehicle(playerid, vehicleid)
{
if(Helmet[playerid] == 1 || Seatbelt[playerid] == 1)
{
if(Helmet[playerid] == 1)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
Helmet[playerid] = 0;
format(string, sizeof(string), "* %s si-a dat jos casca.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
for(new i;i<5;i++) RemovePlayerAttachedObject(playerid,i);
}
if(Seatbelt[playerid] == 1)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
Seatbelt[playerid] = 0;
for(new i;i<5;i++) RemovePlayerAttachedObject(playerid,i);
format(string, sizeof(string), "* %s si-a dat jos centura.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
if(Helmet[playerid] == 0 || Seatbelt[playerid] == 0)
{
Helmet[playerid] = 0;
Seatbelt[playerid] = 0;
return 1;
}
public OnPlayerConnect(playerid)
{
Seatbelt[playerid] = 0;
Helmet[playerid] = 0;
return 1;
}
if(strcmp(cmd, "/cinto", true) == 0)//Edit after your language
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
new newcar = GetPlayerVehicleID(playerid);
if(!strlen(result) && IsPlayerInAnyVehicle(playerid) == 0 || IsPlayerInAnyVehicle(playerid) && IsABMX(newcar) || IsPlayerInAnyVehicle(playerid) && IsAScuterCar(newcar) || IsPlayerInAnyVehicle(playerid) && IsAMotor(newcar))
{ //line 124
SendClientMessage(playerid, COLOR_GRAD2, "Precisa estar em um carro para usar o cinto.");//Edit after your language
return 1;
}
if(IsPlayerInAnyVehicle(playerid) == 1 && Seatbelt[playerid] == 0)
{
Seatbelt[playerid] = 1;
SetPlayerAttachedObject( playerid, 2, 18634, 7,0.000000, 0.100000, 0.350000, -35.224993, 45.215000, 1.500000, 5.000000, 1.500000, 1.500000);
format(string, sizeof(string), "* %s Você colocou o cinto.", sendername);//Edit after your language
}
else if(IsPlayerInAnyVehicle(playerid) == 1 && Seatbelt[playerid] == 1)
{
Seatbelt[playerid] = 0;
for(new i;i<5;i++) RemovePlayerAttachedObject(playerid,i);
format(string, sizeof(string), "* %s Você tirou o cinto.", sendername);//Edit after your language
}
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
printf("%s", string);
}
return 1;
}
Pessoal caso haja algum erro na tradução por exemplo: Você colocou o cinto , inves de Você tirou o cinto me avisem pois eu tive que traduzir de frances para portugues. Obrigado!