02.03.2012, 12:43
Vocк nгo precisa criar times para esta situaзгo, presumo que times dгo lag, entгo use este tipo(gettime):
Teste e vк se funciona!
Ajudei? REP xD
Код:
if(strcmp("/import", cmdtext, true) == 0) { if(roubo[playerid] > gettime()) return SendClientMessage(playerid, cor1, "{FF0000}[ERRO] {ADADAD}Para jб nгo queremos mais carros!"); else { new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, X, Y, Z); if(IsPlayerInRangeOfPoint(playerid,15,89.8899,-305.0462,1.5781)==0) return SendClientMessage(playerid, cor1, "Nгo estas num posto para importar!"); SetPlayerCheckpoint(playerid, 2801.9988,-2356.5833,13.6302,6.0); new pName[MAX_PLAYER_NAME]; GetPlayerName(playerid,pName,sizeof(pName)); new string[248]; format(string,sizeof(string),"Faz como o %s ! Escreve {FA0505}/ajudaimport ",pName); SendClientMessageToAll(cor1, string); SendClientMessage(playerid,0x14B4E3AA, "Leva o carro ate ao destino!"); SetVehicleNumberPlate(CreateVehicle(535, 89.8899,-305.0462,1.5781,0.2829, 145, 145, 100), "IMPORT"); } return 1; } public OnPlayerEnterCheckpoint(playerid) { GetVehicleHealth(veiculo,vidavv); veiculo = GetPlayerVehicleID(playerid); if(!IsPlayerInImportVehicles(playerid)) return SendClientMessage(playerid, cor1, "{FF0000}[ERRO] {ADADAD}Este nгo foi o carro que pedi!"); if(IsPlayerInAnyVehicle(playerid)) { new Float:health; new veh; veh = GetPlayerVehicleID(playerid); GetVehicleHealth(veh, health); if(health <700) { SendClientMessage(playerid, 0x14E551AA, "{FF0000}[Import] {ADADAD}Que mau trabalho! Sу levas metade do pagamento! 1000Ђ"); GivePlayerMoney(playerid, 1000); } if(health >700) { SendClientMessage(playerid, 0x14E551AA, "{FF0000}[Import] {ADADAD}Exelente trabalho, 2000Ђ! Volta dentro de 20min"); GivePlayerMoney(playerid, 2000); } DestroyVehicle(veiculo); roubo[playerid] = gettime() + 300; // 300 = 5 mins neste caso... DisablePlayerCheckpoint(playerid); return 1; } return 1; }
Ajudei? REP xD