CMD:veh(playerid, params[]) {
new Directory[200];
format(Directory, sizeof(Directory), "users/%s.ini", Nome(playerid));
if(dini_Int(Directory, "MyVeh") > -1) DestroyVehicle(dini_Int(Directory, "MyVeh"));
new targetId,cor1,cor2,veh;
if (sscanf(params, "ddd", targetId, cor1, cor2)) return SendClientMessage(playerid, Colorp, "Use: /veh [id] [cor1] [cor2]");
else if (targetId < 400 || targetId > 611) return SendClientMessage(playerid, Colorp, "ID invбlido. Utilize entre 400 e 611.");
else if (cor1 < 0 || cor1 > 126 || cor2 < 0 || cor2 > 126) return SendClientMessage(playerid, Colorp, "Cor invбlida. Utilize entre 0 e 126.");
new Float: pX,Float: pY,Float: pZ;
GetPlayerPos(playerid, pX, pY, pZ);
veh = CreateVehicle(targetId, pX, pY, pZ, 0, cor1, cor2, false);
PutPlayerInVehicle(playerid, veh, 0);
Ini_WriteInt(playerid, "MyVeh", GetPlayerVehicleID(playerid));
return 1;
}
if(strcmp(cmd, "/cv", true) == 0) { new aname[MAX_PLAYER_NAME]; GetPlayerName(playerid, aname, MAX_PLAYER_NAME); format(file, sizeof(file), PASTA_CONTAS, aname); if(pAdmin[playerid] == 2 || pAdmin[playerid] == 3 || pAdmin[playerid] == 4 || pAdmin[playerid] == 5){ new tmp[256]; new plid; //new carro; new Float:X,Float:Y,Float:Z,Float:Angle; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, Vermelho, "** Digite: /cv [id-do-caro]"); return 1; } plid = strval(tmp); if(plid==611){ SendClientMessage(playerid, Vermelho, "** ID de carro Proibido!"); return 1; } if(IsPlayerConnected(playerid)){ if(plid >= 400 && plid <= 611){ GetPlayerPos(playerid,X,Y,Z); GetPlayerFacingAngle(playerid,Angle); new carro = CreateVehicle(plid, X, Y, Z, Angle, -1, -1, 120000); PutPlayerInVehicle(playerid,carro,0); if(GetPlayerInterior(playerid)) LinkVehicleToInterior(carro,GetPlayerInterior(play erid)); SetVehicleVirtualWorld(carro,GetPlayerVirtualWorld (playerid)); format(string, sizeof(string), "* Voc? criou o ve?culo de id: %d", plid); SendClientMessage(playerid, AdminCor, string); return 1; }else{ SendClientMessage(playerid, Vermelho, "** ID inv?lido || ID's = 400-611"); return 1; } } } } |
if(strcmp(cmd, "/pintar", true) == 0) { new aname[MAX_PLAYER_NAME]; GetPlayerName(playerid, aname, MAX_PLAYER_NAME); format(file, sizeof(file), PASTA_CONTAS, aname); if(DOF2_GetInt(file, "Profissao") == Mecanico || DOF2_GetInt(file, "VIP") == 1 || DOF2_GetInt(file, "aAdmin") == 1 || IsPlayerAdmin(playerid) == 1){ new tmp[256]; new cor1,cor2; new veiculo; tmp = strtok(cmdtext,idx); cor1 = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, Vermelho, "/pintar [cor1] [cor2]"); return 1; } |