[Ajuda] como eu crio esse cmd
#1

Como eu crio um comando /queimarmaconha


Tipo... ai em baixo seria mais ou menos se ele n estivesse na sua propria maconha...


mas eu quero queimar uma maconha dos outros...

PHP код:
        if(strcmp(cmdtext"/queimarmaconha"true) == 0)
        {
         new 
file[30], aname[MAX_PLAYER_NAME];
        
GetPlayerName(playeridaname,sizeof(aname));
        
format(filesizeof(file), PASTA_CONTAS1aname);
        if (
PlayerToPoint(3playerid,dini_Float(file"UltimaPosicaoXX"), dini_Float(file"UltimaPosicaoYY"), dini_Float(file"UltimaPosicaoZZ")))
        {
        return 
1;
        }
        
SendClientMessage(playeridBRANCO"teste");
                return 
1;
         } 
PHP код:
    if(strcmp(cmdtext"/plantarmaconha"true) == 0)
    {
        if(
IsPlayerInMorro(playerid) || IsPlayerInShop(playerid) || IsPlayerInPark(playerid) || IsPlayerInCemiterio(playerid)
        || 
IsPlayerInPosto(playerid) || IsPlayerInShop(playerid) || IsPlayerInEstacao(playerid) || IsPlayerInCasarao(playerid) || IsPlayerInPref(playerid))
        {
        return 
SendClientMessage(playeridVERMELHO"Vocк nгo pode plantar aqui, plate fora da cidade ou de um territorio.");
        }
        if(
Infoa[playerid][Grande] >= 5) return SendClientMessage(playeridVERMELHO"Sua maconha esta grande, digite /colhermaconha!");
        if(
GetGranaRockstar(playerid)<2000)return SendClientMessage(playeridBRANCO,"Vocк nгo tem R$2000!");
        if(
PlayerInfo[playerid][pMaconha1]) return SendClientMessage(playeridBRANCO"Vocк jб Plantou maconha!");
        
//if(Infoa[playerid][Arara]) return SendClientMessage(playerid, BRANCO, "Vocк jб Plantou maconha!");
        
SendClientMessage(playeridBRANCO"Vocк Plantou um pй de maconha!");
        
SendClientMessage(playeridBRANCO"Ela irб crescer de Cinco a Cinco Minutos!");
        
SendClientMessage(playeridBRANCO"Nгo se esqueзa de Regar a maconha! /regar!");
        
GranaRockstar(playerid, -2000);
        
Infoa[playerid][Arara] = true;
        
Infoa[playerid][Tempo] = SetTimerEx("Crescimento"300000true"i"playerid);
        new 
Float:XFloat:YFloat:ZFloat:angleaname[MAX_PLAYER_NAME];
        
//new Float:X, Float:Y, Float:Z, Float:A, Float:angle, aname[MAX_PLAYER_NAME];
        
GetPlayerPos(playeridXYZ);
        
//GetPlayerFacingAngle(playerid, A);
        
pMaconhaaa[playerid] = CreateDynamicObject(19473XYZ-20.00.0180);
        
SetPlayerPos(playeridXYZ+4);
        
//
        
GetPlayerName(playeridplayernameMAX_PLAYER_NAME);
        
format(strlabelsizeof(strlabel), "{FFD700}Maconha\n{82FABE}Dono:%s\nStatus:%d/5",playername,Infoa[playerid][Grande]);
        
MyMaconha[playerid] = Create3DTextLabel(strlabelCOR_3DLABELX,Y,Z,40.0,0);
        
//
        
GetPlayerName(playeridaname,sizeof(aname));
        
GetPlayerFacingAngle(playeridangle);
        
//
        
new file[128];
        
format(filesizeof(file), PASTA_CONTAS1aname);
        if(!
dini_Exists(file)) dini_Create(file);
        
dini_FloatSet(file"UltimaPosicaoXX"X);
        
dini_FloatSet(file"UltimaPosicaoYY"Y);
        
dini_FloatSet(file"UltimaPosicaoZZ"Z);
        
dini_FloatSet(file"UltimoAngulo"angle);
        
PlayerInfo[playerid][pMaconha1] = 1//Agora o player tem uma planta
        
return 1;
    } 
Reply
#2

PHP код:
CMD:queimarmaconha(playerid) {
    new 
file[30], aname[MAX_PLAYER_NAME];
    
GetPlayerName(playeridaname,sizeof(aname));
    
format(filesizeof(file), PASTA_CONTAS1aname);
    if (
PlayerToPoint(3playerid,dini_Float(file"UltimaPosicaoXX"), dini_Float(file"UltimaPosicaoYY"), dini_Float(file"UltimaPosicaoZZ"))) return 1;
     else 
SendClientMessage(playeridBRANCO"teste");
    return 
1;

PHP код:
CMD:plantarmaconha(playerid) {
    if(
IsPlayerInMorro(playerid) || IsPlayerInShop(playerid) || IsPlayerInPark(playerid) || IsPlayerInCemiterio(playerid)
    || 
IsPlayerInPosto(playerid) || IsPlayerInShop(playerid) || IsPlayerInEstacao(playerid) || IsPlayerInCasarao(playerid) || IsPlayerInPref(playerid))
    {
        return 
SendClientMessage(playeridVERMELHO"Vocк nгo pode plantar aqui, plate fora da cidade ou de um territorio.");
    }
    if(
Infoa[playerid][Grande] >= 5) return SendClientMessage(playeridVERMELHO"Sua maconha esta grande, digite /colhermaconha!");
    if(
GetGranaRockstar(playerid) < 2000) return SendClientMessage(playeridBRANCO,"Vocк nгo tem R$2000!");
    if(
PlayerInfo[playerid][pMaconha1]) return SendClientMessage(playeridBRANCO"Vocк jб Plantou maconha!");
    
SendClientMessage(playeridBRANCO"Vocк Plantou um pй de maconha!");
    
SendClientMessage(playeridBRANCO"Ela irб crescer de Cinco a Cinco Minutos!");
    
SendClientMessage(playeridBRANCO"Nгo se esqueзa de Regar a maconha! /regar!");
    
GranaRockstar(playerid, -2000);
    
Infoa[playerid][Arara] = true;
    
Infoa[playerid][Tempo] = SetTimerEx("Crescimento"300000true"i"playerid);
    new 
Float:XFloat:YFloat:ZFloat:angleaname[MAX_PLAYER_NAME], file[128];
    
GetPlayerPos(playeridXYZ);
    
pMaconhaaa[playerid] = CreateDynamicObject(19473XYZ-20.00.0180);
    
SetPlayerPos(playeridXYZ+4);
    
GetPlayerName(playeridanamesizeof(aname));
    
format(strlabelsizeof(strlabel), "{FFD700}Maconha\n{82FABE}Dono:%s\nStatus:%d/5"anameInfoa[playerid][Grande]);
    
MyMaconha[playerid] = Create3DTextLabel(strlabelCOR_3DLABELX,Y,Z,40.0,0);
    
GetPlayerFacingAngle(playeridangle);
    
format(filesizeof(file), PASTA_CONTAS1aname);
    if(!
dini_Exists(file)) dini_Create(file);
    
dini_FloatSet(file"UltimaPosicaoXX"X);
    
dini_FloatSet(file"UltimaPosicaoYY"Y);
    
dini_FloatSet(file"UltimaPosicaoZZ"Z);
    
dini_FloatSet(file"UltimoAngulo"angle);
    
PlayerInfo[playerid][pMaconha1] = 1;
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)