format(string,sizeof(string),"Este carro pertence а: %s",CarInfo[i][cOwner]); SendClientMessage(playerid, COLOR_GREEN, string); format(string,sizeof(string),"Vocк pagou R$%d para andar no veiculo de %s",granacarro,CarInfo[i][cOwner]); SendClientMessage(playerid, 0x00F6F6AA, string); CarInfo[i][cGrana] += granacarro; GivePlayerMoneyEx(playerid, -granacarro);
CarInfo[i][cOwned]==1
if(strcmp(cmd, "/compravip", true) == 0) { if(Is247(playerid) || PlayerInfo[playerid][pVIP] < 2) { GetPlayerName(playerid, sendername, sizeof(sendername)); if(IsPlayerConnected(playerid))//Delegado { new x_mi[256]; x_mi = strtok(cmdtext, idx); if(!strlen(x_mi)) { SendClientMessage(playerid, COLOR_WHITE, "|__________________ ESCOLHA SEU OBJETO __________________|"); SendClientMessage(playerid, COLOR_WHITE, "Use: /compravip [troзo ]"); SendClientMessage(playerid, COLOR_GREY, "Numeros: 1 - Barril do Chaves (500$) "); SendClientMessage(playerid, COLOR_GREY, "Numeros: 2 - Cabelo Moicano (500$) "); SendClientMessage(playerid, COLOR_GREY, "Numeros: 3 - Mascara de galinha (500$) "); SendClientMessage(playerid, COLOR_GREY, "Numeros: 4 - Laser (1000$) "); SendClientMessage(playerid, COLOR_GREY, "Numeros: 5 - Arara Azul (1000$) "); SendClientMessage(playerid, COLOR_GREY, "Numeros: 6 - Colete (1000$) "); SendClientMessage(playerid, COLOR_GREY, "Numeros: 7 - Taser (20000$) "); SendClientMessage(playerid, COLOR_WHITE, "|____________________________________________|"); return 1; } if(strcmp(x_mi,"1",true) == 0) { if(IsPlayerConnected(playerid))//Delegado { if (PlayerInfo[playerid][pVIP] < 2) { SendClientMessage(playerid, COLOR_GREY, "Vocк precisa ter 500$!"); return 1; } format(string, sizeof(string), "*%s Comprou barril do chaves", sendername); ProxDetector(100.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); SetPlayerAttachedObject( playerid, 0, 742, 7, -0.129683, -0.024730, -0.006173, 17.348981, 85.127403, 328.808593, 0.930316, 1.000000, 0.884005 ); // pot_03 - chaves chaves chave u.u //SendClientMessage(playerid,COLOR_GREEN,"Voce pegou seu equipamento de COP em Treinamento!"); return 1; } } if(strcmp(x_mi,"2",true) == 0) { if(IsPlayerConnected(playerid))//Delegado { if (PlayerInfo[playerid][pVIP] < 2) { SendClientMessage(playerid, COLOR_GREY, "Vocк precisa ter 500$!"); return 1; } format(string, sizeof(string), "*%s Cortou cabelo moicano", sendername); ProxDetector(100.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); SetPlayerAttachedObject( playerid, 0, 860, 2, -0.129683, -0.013164, -0.006173, 17.348981, 85.127403, 328.808593, 0.930316, 1.000000, 0.884005 ); // sand_plant01 - moicano //SendClientMessage(playerid,COLOR_GREEN,"Voce pegou seu equipamento de COP em Treinamento!"); return 1; } } if(strcmp(x_mi,"3",true) == 0) { if(IsPlayerConnected(playerid))//Delegado { if (PlayerInfo[playerid][pVIP] < 2) { SendClientMessage(playerid, COLOR_GREY, "Vocк precisa ter 500$!"); return 1; } format(string, sizeof(string), "*%s Cortou cabelo moicano", sendername); ProxDetector(100.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); SetPlayerAttachedObject( playerid, 0, 19137, 2, 0.092097, 0.023091, 0.003794, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 ); // CluckinBellHat1 - LBГ‡A GALINHA //SendClientMessage(playerid,COLOR_GREEN,"Voce pegou seu equipamento de COP em Treinamento!"); return 1; } } if(strcmp(x_mi,"4",true) == 0) { if(IsPlayerConnected(playerid))//Delegado { if (PlayerInfo[playerid][pVIP] < 2) { SendClientMessage(playerid, COLOR_GREY, "Vocк precisa ter 1000$!"); return 1; } format(string, sizeof(string), "*%s Comprou um laser", sendername); ProxDetector(100.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); SetPlayerAttachedObject( playerid, 0, 19083, 6, 0.153105, 0.023091, 0.003794, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 ); // LaserPointer5 - laser na mao //SendClientMessage(playerid,COLOR_GREEN,"Voce pegou seu equipamento de COP em Treinamento!"); return 1; } } if(strcmp(x_mi,"5",true) == 0) { if(IsPlayerConnected(playerid))//Delegado { if (PlayerInfo[playerid][pVIP] < 2) { SendClientMessage(playerid, COLOR_GREY, "Vocк precisa ter 1000$!"); return 1; } format(string, sizeof(string), "*%s Comprou uma arara de estimaзгo", sendername); ProxDetector(100.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); SetPlayerAttachedObject( playerid, 0, 19079, 1, 0.349078, -0.048980, 0.085444, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 ); //SendClientMessage(playerid,COLOR_GREEN,"Voce pegou seu equipamento de COP em Treinamento!"); return 1; } } if(strcmp(x_mi,"6",true) == 0) { if(IsPlayerConnected(playerid))//Delegado { if (PlayerInfo[playerid][pVIP] < 2) { SendClientMessage(playerid, COLOR_GREY, "Vocк precisa ter 10000$!"); return 1; } format(string, sizeof(string), "*%s Comprou um colete", sendername); ProxDetector(100.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); SetPlayerAttachedObject( playerid, 0, 19142, 1, 0.100563, 0.056516, 0.003794, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 ); //SendClientMessage(playerid,COLOR_GREEN,"Voce pegou seu equipamento de COP em Treinamento!"); return 1; } } if(strcmp(x_mi,"7",true) == 0) { if(IsPlayerConnected(playerid))//Delegado { if (PlayerInfo[playerid][pVIP] < 2) { SendClientMessage(playerid, COLOR_GREY, "Vocк precisa ser vip$!"); return 1; } format(string, sizeof(string), "*%s Comprou uma blindagem para o carro", sendername); ProxDetector(100.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); SendClientMessage(playerid,TEAM_GROVE_COLOR,"use /blindarcarro para blindar o carro"); //SendClientMessage(playerid,COLOR_GREEN,"Voce pegou seu equipamento de COP em Treinamento!"); return 1; } } } else { SendClientMessage(playerid, COLOR_LIGHTRED, "Vocк nгo estб logado ou nгo existe o numero"); } } else { SendClientMessage(playerid, COLOR_LIGHTRED, "Vocк nгo estб na 24-7"); } }
if(strcmp(cmd, "/compravip", true) == 0)
{
if(!PlayerInfo[playerid][pVIP] < 2) return SendClientMessage(playerid, COLOR_WHITE, "[ERRO] Nгo йs VIP!");
GetPlayerName(playerid, sendername, sizeof(sendername));
if(IsPlayerConnected(playerid))//Delegado
{
new x_mi[256];
x_mi = strtok(cmdtext, idx);
if(!strlen(x_mi))
{
SendClientMessage(playerid, COLOR_WHITE, "|__________________ ESCOLHA SEU OBJETO __________________|");
SendClientMessage(playerid, COLOR_WHITE, "Use: /compravip [troзo ]");
SendClientMessage(playerid, COLOR_GREY, "Numeros: 1 - Barril do Chaves (500$) ");
SendClientMessage(playerid, COLOR_GREY, "Numeros: 2 - Cabelo Moicano (500$) ");
SendClientMessage(playerid, COLOR_GREY, "Numeros: 3 - Mascara de galinha (500$) ");
SendClientMessage(playerid, COLOR_GREY, "Numeros: 4 - Laser (1000$) ");
SendClientMessage(playerid, COLOR_GREY, "Numeros: 5 - Arara Azul (1000$) ");
SendClientMessage(playerid, COLOR_GREY, "Numeros: 6 - Colete (1000$) ");
SendClientMessage(playerid, COLOR_GREY, "Numeros: 7 - Taser (20000$) ");
SendClientMessage(playerid, COLOR_WHITE, "|____________________________________________|");
return 1;
}
}
if(strcmp(x_mi,"1",true) == 0)
{
if(IsPlayerConnected(playerid))//Delegado
{
if (PlayerInfo[playerid][pVIP] < 2)
{
SendClientMessage(playerid, COLOR_GREY, "Vocк precisa ter 500$!");
return 1;
}
format(string, sizeof(string), "*%s Comprou barril do chaves", sendername);
ProxDetector(100.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPlayerAttachedObject( playerid, 0, 742, 7, -0.129683, -0.024730, -0.006173, 17.348981, 85.127403, 328.808593, 0.930316, 1.000000, 0.884005 ); // pot_03 - chaves chaves chave u.u
//SendClientMessage(playerid,COLOR_GREEN,"Voce pegou seu equipamento de COP em Treinamento!");
return 1;
}
}
if(strcmp(x_mi,"2",true) == 0)
{
if(IsPlayerConnected(playerid))//Delegado
{
if (PlayerInfo[playerid][pVIP] < 2)
{
SendClientMessage(playerid, COLOR_GREY, "Vocк precisa ter 500$!");
return 1;
}
format(string, sizeof(string), "*%s Cortou cabelo moicano", sendername);
ProxDetector(100.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPlayerAttachedObject( playerid, 0, 860, 2, -0.129683, -0.013164, -0.006173, 17.348981, 85.127403, 328.808593, 0.930316, 1.000000, 0.884005 ); // sand_plant01 - moicano
//SendClientMessage(playerid,COLOR_GREEN,"Voce pegou seu equipamento de COP em Treinamento!");
return 1;
}
}
if(strcmp(x_mi,"3",true) == 0)
{
if(IsPlayerConnected(playerid))//Delegado
{
if (PlayerInfo[playerid][pVIP] < 2)
{
SendClientMessage(playerid, COLOR_GREY, "Vocк precisa ter 500$!");
return 1;
}
format(string, sizeof(string), "*%s Cortou cabelo moicano", sendername);
ProxDetector(100.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPlayerAttachedObject( playerid, 0, 19137, 2, 0.092097, 0.023091, 0.003794, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 ); // CluckinBellHat1 - LBÇA GALINHA
//SendClientMessage(playerid,COLOR_GREEN,"Voce pegou seu equipamento de COP em Treinamento!");
return 1;
}
}
if(strcmp(x_mi,"4",true) == 0)
{
if(IsPlayerConnected(playerid))//Delegado
{
if (PlayerInfo[playerid][pVIP] < 2)
{
SendClientMessage(playerid, COLOR_GREY, "Vocк precisa ter 1000$!");
return 1;
}
format(string, sizeof(string), "*%s Comprou um laser", sendername);
ProxDetector(100.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPlayerAttachedObject( playerid, 0, 19083, 6, 0.153105, 0.023091, 0.003794, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 ); // LaserPointer5 - laser na mao
//SendClientMessage(playerid,COLOR_GREEN,"Voce pegou seu equipamento de COP em Treinamento!");
return 1;
}
}
if(strcmp(x_mi,"5",true) == 0)
{
if(IsPlayerConnected(playerid))//Delegado
{
if (PlayerInfo[playerid][pVIP] < 2)
{
SendClientMessage(playerid, COLOR_GREY, "Vocк precisa ter 1000$!");
return 1;
}
format(string, sizeof(string), "*%s Comprou uma arara de estimaзгo", sendername);
ProxDetector(100.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPlayerAttachedObject( playerid, 0, 19079, 1, 0.349078, -0.048980, 0.085444, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 );
//SendClientMessage(playerid,COLOR_GREEN,"Voce pegou seu equipamento de COP em Treinamento!");
return 1;
}
}
if(strcmp(x_mi,"6",true) == 0)
{
if(IsPlayerConnected(playerid))//Delegado
{
if (PlayerInfo[playerid][pVIP] < 2)
{
SendClientMessage(playerid, COLOR_GREY, "Vocк precisa ter 10000$!");
return 1;
}
format(string, sizeof(string), "*%s Comprou um colete", sendername);
ProxDetector(100.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPlayerAttachedObject( playerid, 0, 19142, 1, 0.100563, 0.056516, 0.003794, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 );
//SendClientMessage(playerid,COLOR_GREEN,"Voce pegou seu equipamento de COP em Treinamento!");
return 1;
}
}
if(strcmp(x_mi,"7",true) == 0)
{
if(IsPlayerConnected(playerid))//Delegado
{
if (PlayerInfo[playerid][pVIP] < 2)
{
SendClientMessage(playerid, COLOR_GREY, "Vocк precisa ser vip$!");
return 1;
}
format(string, sizeof(string), "*%s Comprou uma blindagem para o carro", sendername);
ProxDetector(100.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendClientMessage(playerid,TEAM_GROVE_COLOR,"use /blindarcarro para blindar o carro");
//SendClientMessage(playerid,COLOR_GREEN,"Voce pegou seu equipamento de COP em Treinamento!");
return 1;
}
}
return 1;
}
3є e ultima Duv Como eu faзo para que tipo,o player fica com um objeto na mгo (ja tenho as coordenadas do objeto) e quadno esse player pega esse objeto,o ataque dele tira 10 a cada vez em que ele ataka? eu vi isso em algum otro fs n sei aonde fiquei procurando que nem um loko mais eu n achei,ai eu queria que o player tirace 10 de life a cada atake que ele fizece :P |
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(IsPlayerAttachedObjectSlotUsed(playerid,SLOT) && newkeys == KEY_FIRE)
{
new Float:Vidaa;
GetPlayerHealth(playerid,Vidaa);
SetPlayerHealth(playerid,Vidaa -10);
}
return 1;
}
// Fixo o Objeto no Player e:
ObjetoAttached[playerid] = 1;
//AGORA Na public da Include:
public OnPlayerShootPlayer(shooter,target,healthlost,armourlost) // algo assim
{
if(ObjetoAttached[shooter] == 1)
{
new Float:Health;
GetPlayerHealth(target,Health);
SetPlayerHealth(target,(Health-10)); // Mude o 10 para o dano extra da arma...
}
// Target = Quem tomou o Tiro
// Shooter = Quem deu o Tiro
// Armour/HealthLost = Colete/Vida Perdida no Tiro
}