07.11.2012, 23:41
tem esse tbm.. de meu gm ;]
/setcar [id] [cor1] [cor2]
/setcar [id] [cor1] [cor2]
pawn Код:
if(strcmp(cmd, "/setcar", true) == 0) {
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(pAdmin[playerid] > 2){
new carid, Float:ang, nome[128], cor1[128], cor2;
new tmp[256];
new gString[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){
SendClientMessage(playerid, tcadm, "ID invбlido. ID's vбlidos: 400 a 611");
return 1;
}
carid = strval(tmp);
if(carid == 425 || carid == 469 || carid == 538 || carid == 537 || carid == 520 || carid == 449 || carid == 447 || carid == 569 || carid == 570 || carid == 432)
{
SendClientMessage(playerid, tcadm, "ERRO: ID invбlido!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, tcadm, "Use: /setcar [id-veiculo] [dono] [cor1] [cor2]");
return 1;
}
strins(nome, tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, tcadm, "Use: /setcar [id-veiculo] [dono] [cor1] [cor2]");
return 1;
}
strins(cor1,tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, tcadm, "Use: /setcar [id-veiculo] [dono] [cor1] [cor2]");
return 1;
}
cor2 = strval(tmp);
if(carid >= 400 && carid <= 611){
if(IsPlayerInAnyVehicle(playerid)){
if(IsNumeric(cor1)){
new playerip[64];
GetPlayerIp(playerid, playerip, sizeof(playerip));
new File:temp;
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
GetVehicleZAngle(GetPlayerVehicleID(playerid),ang);
format(gString, sizeof(gString), "%d %f %f %f %f %s %d //%s - Setado por %s - %s\r\n", carid, X, Y, Z, ang, cor1, cor2, nome, PlayerName(playerid), playerip);
temp = fopen("carros.txt", io_append);
fwrite(temp, gString);
fclose(temp);
SendClientMessage(playerid, COLOR_GREEN, "Carro setado com sucesso.");
printf("%s acaba de setar um carro para %s - %s.", PlayerName(playerid), nome, playerip);
SetTimerEx("CriarVeiculo",10000,false,"dffffdd",carid,X,Y,Z,ang,strval(cor1),cor2);
return 1;
} else {
SendClientMessage(playerid, tcadm,"Use: /setcar [id-veiculo] [carro-local-ou-dono] [cor1] [cor2]");
return 1;
}
}
else{
SendClientMessage(playerid, tcadm, "Vocк nгo estб em nenhum veнculo e assim nгo pode setar um carro.");
return 1;
}
}
else{
SendClientMessage(playerid, tcadm, "ID fora do normal | ID's = 400-611");
return 1;
}
} else {
SendClientMessage(playerid, tcadm, "Vocк nгo tem permissгo para isso");
return 1;
}
}