wrong commands
#1

well,in my script i got zcmd and strcmp ,both used,how can i detect if he wrote a command that doesnt exist in strcmp and ZCMD and send him error message?
Reply
#2

Just convert the strcmp into zcmd, it will save you a major headache.
Reply
#3

You can't use OnPlayerCommandText if you included ZCMD.

If I understand what you want to do, you want to send an error message if the command doesn't exist with ZCMD.
You must use OnPlayerCommandPerformed, like that

PHP код:
public OnPlayerCommandPerformed(playeridcmdtext[], success)
    return (!
success SendClientMessage(playerid, -1"Unknown command, use /help.") : 1); 
Reply
#4

Well,i got strcmp and zcmd in my gamemode,both working but i want a way to detect if the command doesnt exist in strcmp and zcmd not only zcmd
Reply
#5

Did you read ?
Quote:

You can't use OnPlayerCommandText if you included ZCMD

Reply
#6

The simple way is the "OnPlayerCommandPerformed(playerid, cmdtext[], success)" convert all your strcmp commands to ZCMD and use this callback like dutheil said you.
Reply
#7

You may find this helpful: https://sampforum.blast.hk/showthread.php?tid=276063
Reply
#8

Quote:
Originally Posted by Dutheil
Посмотреть сообщение
You can't use OnPlayerCommandText if you included ZCMD.

If I understand what you want to do, you want to send an error message if the command doesn't exist with ZCMD.
You must use OnPlayerCommandPerformed, like that

PHP код:
public OnPlayerCommandPerformed(playeridcmdtext[], success)
    return (!
success SendClientMessage(playerid, -1"Unknown command, use /help.") : 1); 

Who said we can't use? I used it and it worked too..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)