One Error, Please help me with my script.
#1

Alright, I've followed the steps of some tutorial to add a /ajail CMD yet i keep getting 1 Error.

Errors:
Код:
C:\Users\Cyrus\Desktop\ZG-RP\gamemodes\ZGRP.pwn(37) : warning 201: redefinition of constant/macro (symbol "strcpy(%0,%1,%2)")
C:\Users\Cyrus\Desktop\ZG-RP\gamemodes\ZGRP.pwn(6527) : error 017: undefined symbol "Name"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
My script : http://pastebin.com/VNw9NBR3
Reply
#2

You redefined strcpy, hence forth the obvious error. Remove that line.

Name is undefined, define it. It looks like you are using it as a stock, so place this near your other stocks

pawn Код:
stock Name(playerid)
{
    if(!IsPlayerConnected(playerid)) return 1;
    new pName[24];
    GetPlayerName(playerid, pName, sizeof(pName));
    return pName;
}
Reply
#3

I've just added that stock near my others and now i have another error.
Код:
 C:\Users\Cyrus\Desktop\ZG-RP\gamemodes\ZGRP.pwn(675) : error 079: inconsistent return types (array & non-array)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#4

What line is that shown on?
Reply
#5

top of your script ,
pawn Код:
new Name[MAX_PLAYER_NAME];
Reply
#6

675:
Код:
 if(!IsPlayerConnected(playerid)) return 1;
Reply
#7

Just remove that line, not really needed.
Reply
#8

pawn Код:
new pID;
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid,COLOR_RED,"[ERROR]: Player is not Connected! ");//checks if player is not connected
Reply
#9

Thanks Kindred +Rep'd
Reply
#10

Quote:
Originally Posted by Devilxz97
Посмотреть сообщение
pawn Код:
new pID;
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid,COLOR_RED,"[ERROR]: Player is not Connected! ");//checks if player is not connected
Lols, seriously, learn to script before you do this shit.

It was probably because of the return 1, considering I was returning a string if it was getting his name and returning a value if not.

This code simply creates a random variable, does nothing with it, and sees if a player is online with it. If you did this, it would check if player id 0 is online, since 0 is the default value of the variable (if correct).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)