/me /do /b /c /s Commands
#1

Hey guys i am new programming with zcmd and everyone suggest me to start to use zcmd because works better etc etc, im trying to start a project roleplay from 0 , can you help me to change strcmp to zcmd please:

PHP код:
if(strcmp(cmd"/me"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerInfo[playerid][pBanished] == 1)
            {
                
SendClientMessage(playeridCOLOR_GREY"YOU CAN'T DO SHIT!");
                return 
1;
            }
            if(
gPlayerLogged[playerid] == 0)
            {
                
SendClientMessage(playeridCOLOR_GREY"   You havent logged in yet !");
                return 
1;
            }
            
GetPlayerName(playeridsendernamesizeof(sendername));
            new 
length strlen(cmdtext);
            while ((
idx length) && (cmdtext[idx] <= ' '))
            {
                
idx++;
            }
            new 
offset idx;
            new 
result[64];
            while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
            {
                
result[idx offset] = cmdtext[idx];
                
idx++;
            }
            
result[idx offset] = EOS;
            if(!
strlen(result))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /me [action]");
                return 
1;
            }
            
format(stringsizeof(string), "* %s %s"sendernameresult);
            
ProxDetectorVw(30.0GetPlayerVirtualWorld(playerid), playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            
printf("%s"string);
        }
        return 
1;
    }
    if(
strcmp(cmd"/do"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
gPlayerLogged[playerid] == 0)
            {
                
SendClientMessage(playeridCOLOR_GREY"   You did not log in yet !");
                return 
1;
            }
            
GetPlayerName(playeridsendernamesizeof(sendername));
            new 
length strlen(cmdtext);
            while ((
idx length) && (cmdtext[idx] <= ' '))
            {
                
idx++;
            }
            new 
offset idx;
            new 
result[64];
            while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
            {
                
result[idx offset] = cmdtext[idx];
                
idx++;
            }
            
result[idx offset] = EOS;
            if(!
strlen(result))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /do [action]");
                return 
1;
            }
            
format(stringsizeof(string), "* %s %s"sendernameresult);
            
ProxDetector(30.0playeridstringCOLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
            
printf("%s"string);
        }
        return 
1;
    }
if(
strcmp(cmd"/b"true) == 0)//local ooc
    
{
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerInfo[playerid][pBanished] == 1)
            {
                
SendClientMessage(playeridCOLOR_GREY"YOU CAN'T DO SHIT!");
                return 
1;
            }
            if(
gPlayerLogged[playerid] == 0)
            {
                
SendClientMessage(playeridCOLOR_GREY"   You havent logged in yet !");
                return 
1;
            }
            
GetPlayerName(playeridsendernamesizeof(sendername));
            new 
length strlen(cmdtext);
            while ((
idx length) && (cmdtext[idx] <= ' '))
            {
                
idx++;
            }
            new 
offset idx;
            new 
result[64];
            while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
            {
                
result[idx offset] = cmdtext[idx];
                
idx++;
            }
            
result[idx offset] = EOS;
            if(!
strlen(result))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /b [local ooc chat]");
                return 
1;
            }
            
format(stringsizeof(string), "%s Says: (( %s ))"sendernameresult);
            
ProxDetectorVw(20.0GetPlayerVirtualWorld(playerid), playeridstring,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
            
printf("%s"string);
        }
        return 
1;
    }
    if(
strcmp(cmd"/close"true) == || strcmp(cmd"/c"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerInfo[playerid][pBanished] == 1)
            {
                
SendClientMessage(playeridCOLOR_GREY"YOU CAN'T DO SHIT!");
                return 
1;
            }
            if(
gPlayerLogged[playerid] == 0)
            {
                
SendClientMessage(playeridCOLOR_GREY"   You havent logged in yet !");
                return 
1;
            }
            
GetPlayerName(playeridsendernamesizeof(sendername));
            new 
length strlen(cmdtext);
            while ((
idx length) && (cmdtext[idx] <= ' '))
            {
                
idx++;
            }
            new 
offset idx;
            new 
result[64];
            while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
            {
                
result[idx offset] = cmdtext[idx];
                
idx++;
            }
            
result[idx offset] = EOS;
            if(!
strlen(result))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /©lose [close chat text]");
                return 
1;
            }
            
format(stringsizeof(string), "%s Says: %s"sendernameresult);
            
ProxDetectorVw(3.0GetPlayerVirtualWorld(playerid), playeridstring,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
            
printf("%s"string);
        }
        return 
1;
    }
    if(
strcmp(cmd"/shout"true) == || strcmp(cmd"/s"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerInfo[playerid][pBanished] == 1)
            {
                
SendClientMessage(playeridCOLOR_GREY"YOU CAN'T DO SHIT!");
                return 
1;
            }
            if(
gPlayerLogged[playerid] == 0)
            {
                
SendClientMessage(playeridCOLOR_GREY"   You havent logged in yet !");
                return 
1;
            }
            
GetPlayerName(playeridsendernamesizeof(sendername));
            new 
length strlen(cmdtext);
            while ((
idx length) && (cmdtext[idx] <= ' '))
            {
                
idx++;
            }
            new 
offset idx;
            new 
result[64];
            while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
            {
                
result[idx offset] = cmdtext[idx];
                
idx++;
            }
            
result[idx offset] = EOS;
            if(!
strlen(result))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USAGE: (/s)hout [local chat]");
                return 
1;
            }
            
format(stringsizeof(string), "%s Shouts: %s!"sendernameresult);
            
ProxDetectorVw(25.0GetPlayerVirtualWorld(playerid), playeridstring,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_FADE1,COLOR_FADE2);
            
printf("%s"string);
        }
        return 
1;
    } 
Thanks for your time
Reply
#2

Hey pal whta can i do here?

Код HTML:
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1298) : error 017: undefined symbol "string"
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1298) : error 017: undefined symbol "string"
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1298) : error 029: invalid expression, assumed zero
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1298) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
line 1298

PHP код:
            format(stringsizeof(string), "* %s %s"sendernameparams); 
Reply
#3

Код HTML:
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1284) : warning 217: loose indentation
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1302) : error 017: undefined symbol "sendername"
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1303) : error 017: undefined symbol "ProxDetectorVw"
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1319) : error 017: undefined symbol "sendername"
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1319) : error 017: undefined symbol "sendername"
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1319) : error 029: invalid expression, assumed zero
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1319) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
line 1284 to 1319

PHP код:
if(IsPlayerConnected(playerid))
        {
            if(
PlayerInfo[playerid][pBanished] == 1)
            {
                
SendClientMessage(playeridCOLOR_GREY"YOU CAN'T DO SHIT!");
                return 
1;
            }
            if(
gPlayerLogged[playerid] == 0)
            {
                
SendClientMessage(playeridCOLOR_GREY"   You havent logged in yet !");
                return 
1;
            }
            if(
isnull(params))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /me [action]");
                return 
1;
            }
            
format(stringsizeof(string), "* %s %s"sendernameparams);
            
ProxDetectorVw(30.0GetPlayerVirtualWorld(playerid), playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            
printf("%s"string);
        }
        return 
1;
    }
CMD:do(playeridparams[])
    {
        new 
string[128];
        if(
IsPlayerConnected(playerid))
        {
            if(
gPlayerLogged[playerid] == 0)
            {
                
SendClientMessage(playeridCOLOR_GREY"   You did not log in yet !");
                return 
1;
            }
            
GetPlayerName(playeridsendernamesizeof(sendername)); 
Reply
#4

Put
new sendername[MAX_PLAYER_NAME]; in each of the commands and i dont know about that proxdetectorvw, maybe it should be a stock that is not defined just as proxdetector.
or simply rename proxdetectorvw as ProxDetector
Reply
#5

send me this i fix csome errors but now

Код HTML:
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1307) : error 004: function "ProxDetectorVw" is not implemented
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1310) : warning 217: loose indentation
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1332) : error 004: function "ProxDetector" is not implemented
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1342) : warning 217: loose indentation
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1362) : error 004: function "ProxDetectorVw" is not implemented
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1376) : warning 217: loose indentation
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1396) : error 004: function "ProxDetectorVw" is not implemented
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1411) : warning 217: loose indentation
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1431) : error 004: function "ProxDetectorVw" is not implemented
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
lines

PHP код:
ProxDetectorVw(30.0GetPlayerVirtualWorld(playerid), playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            
printf("%s"string);
        }
        return 
1;
    }
CMD:do(playeridparams[])
    {
        new 
string[128];
        new 
sendername[MAX_PLAYER_NAME];
        if(
IsPlayerConnected(playerid))
        {
            if(
gPlayerLogged[playerid] == 0)
            {
                
SendClientMessage(playeridCOLOR_GREY"   You did not log in yet !");
                return 
1;
            }
            
GetPlayerName(playeridsendernamesizeof(sendername));
            if(
isnull(params))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /do [action]");
                return 
1;
            }
            
format(stringsizeof(string), "* %s %s"sendernameparams);
            
ProxDetector(30.0playeridstringCOLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
            
printf("%s"string);
        }
        return 
1;
    }
CMD:b(playeridparams[])
    {
new 
string[128];
new 
sendername[MAX_PLAYER_NAME];
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerInfo[playerid][pBanished] == 1)
            {
                
SendClientMessage(playeridCOLOR_GREY"YOU CAN'T DO SHIT!");
                return 
1;
            }
            if(
gPlayerLogged[playerid] == 0)
            {
                
SendClientMessage(playeridCOLOR_GREY"   You havent logged in yet !");
                return 
1;
            }
            
GetPlayerName(playeridsendernamesizeof(sendername));
            if(
isnull(params))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /b [local ooc chat]");
                return 
1;
            }
            
format(stringsizeof(string), "%s Says: (( %s ))"sendernameparams);
            
ProxDetectorVw(20.0GetPlayerVirtualWorld(playerid), playeridstring,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
            
printf("%s"string);
        }
        return 
1;
    }
 
CMD:c(playeridparams[])
{
 return 
cmd_close(playeridparams);
}
    
CMD:close(playeridparams[])
    {
new 
string[128];
new 
sendername[MAX_PLAYER_NAME];
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerInfo[playerid][pBanished] == 1)
            {
                
SendClientMessage(playeridCOLOR_GREY"YOU CAN'T DO SHIT!");
                return 
1;
            }
            if(
gPlayerLogged[playerid] == 0)
            {
                
SendClientMessage(playeridCOLOR_GREY"   You havent logged in yet !");
                return 
1;
            }
            
GetPlayerName(playeridsendernamesizeof(sendername));
            if(
isnull(params))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /©lose [close chat text]");
                return 
1;
            }
            
format(stringsizeof(string), "%s Says: %s"sendernameparams);
            
ProxDetectorVw(3.0GetPlayerVirtualWorld(playerid), playeridstring,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
            
printf("%s"string);
        }
        return 
1;
    }
 
CMD:s(playeridparams[])
{
  return 
cmd_shout(playeridparams);
}
   
CMD:shout(playeridparams[])
    {
new 
string[128];
new 
sendername[MAX_PLAYER_NAME];
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerInfo[playerid][pBanished] == 1)
            {
                
SendClientMessage(playeridCOLOR_GREY"YOU CAN'T DO SHIT!");
                return 
1;
            }
            if(
gPlayerLogged[playerid] == 0)
            {
                
SendClientMessage(playeridCOLOR_GREY"   You havent logged in yet !");
                return 
1;
            }
            
GetPlayerName(playeridsendernamesizeof(sendername));
            if(
isnull(params))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USAGE: (/s)hout [local chat]");
                return 
1;
            }
            
format(stringsizeof(string), "%s Shouts: %s!"sendernameparams);
            
ProxDetectorVw(25.0GetPlayerVirtualWorld(playerid), playeridstring,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_FADE1,COLOR_FADE2);
            
printf("%s"string);
        }
        return 
1;
    } 
Reply
#6

i set this on my gm

PHP код:
forward ProxDetector(Float:radiplayeridstring[],col1,col2,col3,col4,col5);
forward ProxDetectorVw(Float:radivWorldplayeridstring[],col1,col2,col3,col4,col5); 
its correct or not?
Reply
#7

This is because the proxdetector stock is not defined to be used for virtual world
PHP код:
ProxDetectorVw(30.0GetPlayerVirtualWorld(playerid), playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); 
change to
PHP код:
ProxDetectorVw(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); 
you just need to remove GetPlayerVirtualWorld(playerid) from the line.
Reply
#8

almost the same:

Код HTML:
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1307) : error 004: function "ProxDetectorVw" is not implemented
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1310) : warning 217: loose indentation
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1332) : error 004: function "ProxDetector" is not implemented
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1342) : warning 217: loose indentation
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1362) : error 004: function "ProxDetectorVw" is not implemented
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1376) : warning 217: loose indentation
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1396) : error 004: function "ProxDetectorVw" is not implemented
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1411) : warning 217: loose indentation
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1431) : error 004: function "ProxDetectorVw" is not implemented
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
PHP код:
ProxDetectorVw(30.0,playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            
printf("%s"string);
        }
        return 
1;
    }
CMD:do(playeridparams[])
    {
        new 
string[128];
        new 
sendername[MAX_PLAYER_NAME];
        if(
IsPlayerConnected(playerid))
        {
            if(
gPlayerLogged[playerid] == 0)
            {
                
SendClientMessage(playeridCOLOR_GREY"   You did not log in yet !");
                return 
1;
            }
            
GetPlayerName(playeridsendernamesizeof(sendername));
            if(
isnull(params))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /do [action]");
                return 
1;
            }
            
format(stringsizeof(string), "* %s %s"sendernameparams);
            
ProxDetector(30.0playeridstringCOLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
            
printf("%s"string);
        }
        return 
1;
    }
CMD:b(playeridparams[])
    {
new 
string[128];
new 
sendername[MAX_PLAYER_NAME];
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerInfo[playerid][pBanished] == 1)
            {
                
SendClientMessage(playeridCOLOR_GREY"YOU CAN'T DO SHIT!");
                return 
1;
            }
            if(
gPlayerLogged[playerid] == 0)
            {
                
SendClientMessage(playeridCOLOR_GREY"   You havent logged in yet !");
                return 
1;
            }
            
GetPlayerName(playeridsendernamesizeof(sendername));
            if(
isnull(params))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /b [local ooc chat]");
                return 
1;
            }
            
format(stringsizeof(string), "%s Says: (( %s ))"sendernameparams);
            
ProxDetectorVw(20.0,playeridstring,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
            
printf("%s"string);
        }
        return 
1;
    }
 
CMD:c(playeridparams[])
{
 return 
cmd_close(playeridparams);
}
    
CMD:close(playeridparams[])
    {
new 
string[128];
new 
sendername[MAX_PLAYER_NAME];
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerInfo[playerid][pBanished] == 1)
            {
                
SendClientMessage(playeridCOLOR_GREY"YOU CAN'T DO SHIT!");
                return 
1;
            }
            if(
gPlayerLogged[playerid] == 0)
            {
                
SendClientMessage(playeridCOLOR_GREY"   You havent logged in yet !");
                return 
1;
            }
            
GetPlayerName(playeridsendernamesizeof(sendername));
            if(
isnull(params))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /©lose [close chat text]");
                return 
1;
            }
            
format(stringsizeof(string), "%s Says: %s"sendernameparams);
            
ProxDetectorVw(3.0,playeridstring,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
            
printf("%s"string);
        }
        return 
1;
    }
 
CMD:s(playeridparams[])
{
  return 
cmd_shout(playeridparams);
}
   
CMD:shout(playeridparams[])
    {
new 
string[128];
new 
sendername[MAX_PLAYER_NAME];
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerInfo[playerid][pBanished] == 1)
            {
                
SendClientMessage(playeridCOLOR_GREY"YOU CAN'T DO SHIT!");
                return 
1;
            }
            if(
gPlayerLogged[playerid] == 0)
            {
                
SendClientMessage(playeridCOLOR_GREY"   You havent logged in yet !");
                return 
1;
            }
            
GetPlayerName(playeridsendernamesizeof(sendername));
            if(
isnull(params))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USAGE: (/s)hout [local chat]");
                return 
1;
            }
            
format(stringsizeof(string), "%s Shouts: %s!"sendernameparams);
            
ProxDetectorVw(25.0playeridstring,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_FADE1,COLOR_FADE2); 
Reply
#9

I meant that you should change ProxDetectorVw to ProxDetector. like
Quote:

ProxDetector(3.0,playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_F ADE4,COLOR_FADE5);

Reply
#10

what about the loose identation?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)